[FFmpeg-devel] [PATCH] Clean up ipv6 vs the udp protocol

Luca Abeni lucabe72
Tue Jan 12 11:43:34 CET 2010


Martin Storsj? wrote:
> On Tue, 12 Jan 2010, Luca Abeni wrote:
> 
>> I am obviously missing something, but...
>> [...]
>> @@ -182,9 +177,11 @@ static int is_multicast_address(struct sockaddr *addr)
>>      if (addr->sa_family == AF_INET) {
>>          return IN_MULTICAST(ntohl(((struct sockaddr_in
>> *)addr)->sin_addr.s_addr));
>>      }
>> +#if CONFIG_IPV6_MULTICAST
>>      if (addr->sa_family == AF_INET6) {
>>          return IN6_IS_ADDR_MULTICAST(&((struct sockaddr_in6
>> *)addr)->sin6_addr);
>>      }
>> +#endif
>> [...]
>> Why is this needed?
> 
> We can't rely on having struct sockaddr_in6 available.

Well, I think if there is no sockaddr_in6 there is no IPv6 too.
So, CONFIG_IPV6 seems to be a better name than CONFIG_IPV6_MULTICAST.
(the point being: sockaddr_in6 is related to IPv6, not to IPv6
multicast).
Or maybe the best thing would be to have HAVE_SOCKADDR_IN6,
instead of a CONFIG_* thing.

Based on this, I think your third patch should just check for the
presence of sockaddr_in6, instead of checking for IN6_IS_ADDR_MULTICAST...
No?


				Luca



More information about the ffmpeg-devel mailing list