[FFmpeg-trac] #9449(avformat:new): FFmpeg UDP multicast support broken on OpenBSD

FFmpeg trac at avcodec.org
Fri Oct 29 01:22:05 EEST 2021


#9449: FFmpeg UDP multicast support broken on OpenBSD
-------------------------------------+-------------------------------------
             Reporter:  Brad Smith   |                    Owner:  (none)
                 Type:  defect       |                   Status:  new
             Priority:  important    |                Component:  avformat
              Version:  git-master   |               Resolution:
             Keywords:  udp          |               Blocked By:
  multicast                          |
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
Comment (by Brad Smith):

 There was a diff that was suggested but I am not sure this is the way you
 want to go.

 {{{
 @@ -161,9 +161,10 @@ static const AVClass udplite_context_class = {
  static int udp_set_multicast_ttl(int sockfd, int mcastTTL,
                                   struct sockaddr *addr)
  {
 +  unsigned char mcastTTLc = mcastTTL;
  #ifdef IP_MULTICAST_TTL
      if (addr->sa_family == AF_INET) {
 -        if (setsockopt(sockfd, IPPROTO_IP, IP_MULTICAST_TTL, &mcastTTL,
 sizeof(mcastTTL)) < 0) {
 +        if (setsockopt(sockfd, IPPROTO_IP, IP_MULTICAST_TTL, &mcastTTLc,
 sizeof(mcastTTLc)) < 0) {
              ff_log_net_error(NULL, AV_LOG_ERROR,
 "setsockopt(IP_MULTICAST_TTL)");
              return ff_neterrno();
          }
 @@ -171,7 +172,7 @@ static int udp_set_multicast_ttl(int sockfd, int mcast
  #endif
  #if defined(IPPROTO_IPV6) && defined(IPV6_MULTICAST_HOPS)
      if (addr->sa_family == AF_INET6) {
 -        if (setsockopt(sockfd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS,
 &mcastTTL, sizeof(mcastTTL)) < 0) {
 +        if (setsockopt(sockfd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS,
 &mcastTTLc, sizeof(mcastTTLc)) < 0) {
              ff_log_net_error(NULL, AV_LOG_ERROR,
 "setsockopt(IPV6_MULTICAST_HOPS)");
              return ff_neterrno();
          }
 }}}
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/9449#comment:1>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list