Alexander Bluhm:

> naddy: How do you work around this problem currently in your setup?

I carry along the patch below (from mpi@).

Index: netinet6/nd6_nbr.c
===================================================================
RCS file: /cvs/src/sys/netinet6/nd6_nbr.c,v
retrieving revision 1.113
diff -u -p -r1.113 nd6_nbr.c
--- netinet6/nd6_nbr.c  22 Dec 2016 13:39:32 -0000      1.113
+++ netinet6/nd6_nbr.c  26 Dec 2016 20:11:01 -0000
@@ -433,54 +433,23 @@ nd6_ns_output(struct ifnet *ifp, struct 
        }
        ip6->ip6_dst = dst_sa.sin6_addr;
        if (!dad) {
-               /*
-                * RFC2461 7.2.2:
-                * "If the source address of the packet prompting the
-                * solicitation is the same as one of the addresses assigned
-                * to the outgoing interface, that address SHOULD be placed
-                * in the IP Source Address of the outgoing solicitation.
-                * Otherwise, any one of the addresses assigned to the
-                * interface should be used."
-                *
-                * We use the source address for the prompting packet
-                * (saddr6), if:
-                * - saddr6 is given from the caller (by giving "ln"), and
-                * - saddr6 belongs to the outgoing interface.
-                * Otherwise, we perform the source address selection as usual.
-                */
-               struct ip6_hdr *hip6;           /* hold ip6 */
-               struct in6_addr *saddr6;
+                /* Perform source address selection. */
+               struct rtentry *rt;
 
-               if (ln && ln->ln_hold) {
-                       hip6 = mtod(ln->ln_hold, struct ip6_hdr *);
-                       /* XXX pullup? */
-                       if (sizeof(*hip6) < ln->ln_hold->m_len)
-                               saddr6 = &hip6->ip6_src;
-                       else
-                               saddr6 = NULL;
-               } else
-                       saddr6 = NULL;
-               if (saddr6 && in6ifa_ifpwithaddr(ifp, saddr6))
-                       src_sa.sin6_addr = *saddr6;
-               else {
-                       struct rtentry *rt;
+               rt = rtalloc(sin6tosa(&dst_sa), RT_RESOLVE,
+                   m->m_pkthdr.ph_rtableid);
+               if (!rtisvalid(rt)) {
+                       char addr[INET6_ADDRSTRLEN];
 
-                       rt = rtalloc(sin6tosa(&dst_sa), RT_RESOLVE,
-                           m->m_pkthdr.ph_rtableid);
-                       if (!rtisvalid(rt)) {
-                               char addr[INET6_ADDRSTRLEN];
-
-                               nd6log((LOG_DEBUG,
-                                   "%s: source can't be determined: dst=%s\n",
-                                   __func__, inet_ntop(AF_INET6,
-                                   &dst_sa.sin6_addr, addr, sizeof(addr))));
-                               rtfree(rt);
-                               goto bad;
-                       }
-                       src_sa.sin6_addr =
-                           ifatoia6(rt->rt_ifa)->ia_addr.sin6_addr;
+                       nd6log((LOG_DEBUG,
+                           "%s: source can't be determined: dst=%s\n",
+                           __func__, inet_ntop(AF_INET6,
+                           &dst_sa.sin6_addr, addr, sizeof(addr))));
                        rtfree(rt);
+                       goto bad;
                }
+               src_sa.sin6_addr = ifatoia6(rt->rt_ifa)->ia_addr.sin6_addr;
+               rtfree(rt);
        } else {
                /*
                 * Source address for DAD packet must always be IPv6
-- 
Christian "naddy" Weisgerber                          [email protected]

Reply via email to