Current-Users archive

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

Re: wm DAD duplicate address



On 21/02/2017 12:32, Patrick Welche wrote:
> On Tue, Feb 21, 2017 at 12:25:00PM +0000, Patrick Welche wrote:
>> wm2: DAD defended address 0.0.0.0 from 00:15:17:1a:48:1d
>> wm2: DAD defence failed for 0.0.0.0 from 00:15:17:1a:48:1d
>> wm2: DAD duplicate address 0.0.0.0 from 00:15:17:1a:48:1d
> ...
> Reverse Request who-is 00:15:17:22:6c:e0 tell 00:15:17:22:6c:e0, length 46
> Request who-has 169.254.95.254 tell 169.254.95.254, length 28
> 
> etc., and no 0.0.0.0 to be seen anywhere by tcpdump

So the DAD reporting reports on an address assigned to the interface,
not the actual address from the ARP message.
There is code to pick the first address from the interface if none match
the ARP message, the below patch skips DAD if that happens.

Does it help?

Roy


Index: sys/netinet/if_arp.c
===================================================================
RCS file: /cvsroot/src/sys/netinet/if_arp.c,v
retrieving revision 1.242
diff -u -p -r1.242 if_arp.c
--- sys/netinet/if_arp.c        11 Feb 2017 15:37:30 -0000      1.242
+++ sys/netinet/if_arp.c        24 Feb 2017 09:37:36 -0000
@@ -1018,6 +1018,7 @@ in_arpinput(struct mbuf *m)
        int s;
        char llabuf[LLA_ADDRSTRLEN];
        char ipbuf[INET_ADDRSTRLEN];
+       bool do_dad;

        if (__predict_false(m_makewritable(&m, 0, m->m_pkthdr.len,
M_DONTWAIT)))
                goto out;
@@ -1113,6 +1114,9 @@ in_arpinput(struct mbuf *m)
                goto out;
        }

+       /* Only do DaD if we have a matching address. */
+       do_dad = (ia != NULL);
+
        if (ia == NULL) {
                ia = in_get_ia_on_iface_psref(isaddr, rcvif, &psref_ia);
                if (ia == NULL) {
@@ -1160,9 +1164,10 @@ in_arpinput(struct mbuf *m)
        }

        /* DAD check, RFC 5227 */
-       if (in_hosteq(isaddr, myaddr) ||
+       if (do_dad &&
+           (in_hosteq(isaddr, myaddr) ||
            (in_nullhost(isaddr) && in_hosteq(itaddr, myaddr)
-           && ISSET(m->m_flags, M_BCAST))) /* Allow Unicast Poll, RFC
1122 */
+           && ISSET(m->m_flags, M_BCAST)))) /* Allow Unicast Poll, RFC
1122 */
        {
                arp_dad_duplicated((struct ifaddr *)ia,
                    lla_snprintf(llabuf, ar_sha(ah), ah->ar_hln));




Home | Main Index | Thread Index | Old Index