tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bind() to IPv6 link-local multicast group gives EADDRNOTAVAIL



In article <53CF5BF8.4000402%bbn.com@localhost>, Richard Hansen  
<rhansen%bbn.com@localhost> wrote:
>Hi all,
>
>It seems to me like in6_pcbbind_addr() should have another 'else if'
>condition before line 241:
>
>    } else if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) {
>        ...
>
>Or am I doing something wrong?

Does this work for you? (similar to in_pcbbind_addr())...

christos

Index: in6_pcb.c
===================================================================
RCS file: /cvsroot/src/sys/netinet6/in6_pcb.c,v
retrieving revision 1.125
diff -u -p -u -r1.125 in6_pcb.c
--- in6_pcb.c   30 May 2014 01:39:03 -0000      1.125
+++ in6_pcb.c   23 Jul 2014 11:10:23 -0000
@@ -218,7 +218,9 @@ in6_pcbbind_addr(struct in6pcb *in6p, st
        if ((error = sa6_embedscope(sin6, ip6_use_defzone)) != 0)
                return (error);
 
-       if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) {
+       if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) {
+               /* always succeed */
+       } else if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) {
                if ((in6p->in6p_flags & IN6P_IPV6_V6ONLY) != 0)
                        return (EINVAL);
                if (sin6->sin6_addr.s6_addr32[3]) {



Home | Main Index | Thread Index | Old Index