From: Vlad Yasevich <vladislav.yasevich@hp.com>
To: Neil Horman <nhorman@tuxdriver.com>
Cc: "Mika Penttilä" <mika.penttila@kolumbus.fi>,
yoshfuji@linux-ipv6.org, davem@davemloft.net,
kuznet@ms2.inr.ac.ru, pekkas@netcore.fi, jmorris@namei.org,
kaber@coreworks.de, netdev@vger.kernel.org
Subject: Re: [PATCH] IPv6: Implement RFC 4429 Optimistic Duplicate Address Detection
Date: Mon, 22 Jan 2007 15:25:39 -0500 [thread overview]
Message-ID: <45B51DC3.1010303@hp.com> (raw)
In-Reply-To: <20070122194548.GE21059@hmsreliant.homelinux.net>
Hi Neil
I don't this is still right...
> @@ -746,6 +772,7 @@ static void ndisc_recv_ns(struct sk_buff *skb)
> int dad = ipv6_addr_any(saddr);
> int inc;
> int is_router;
> + int type;
>
> if (ipv6_addr_is_multicast(&msg->target)) {
> ND_PRINTK2(KERN_WARNING
> @@ -796,14 +823,8 @@ static void ndisc_recv_ns(struct sk_buff *skb)
> inc = ipv6_addr_is_multicast(daddr);
>
> if ((ifp = ipv6_get_ifaddr(&msg->target, dev, 1)) != NULL) {
> - if (ifp->flags & IFA_F_TENTATIVE) {
> - /* Address is tentative. If the source
> - is unspecified address, it is someone
> - does DAD, otherwise we ignore solicitations
> - until DAD timer expires.
> - */
> - if (!dad)
> - goto out;
> +
> + if (ifp->flags & (IFA_F_TENTATIVE|IFA_F_OPTIMISTIC)) {
> if (dev->type == ARPHRD_IEEE802_TR) {
> unsigned char *sadr = skb->mac.raw;
> if (((sadr[8] ^ dev->dev_addr[0]) & 0x7f) == 0 &&
> @@ -816,8 +837,23 @@ static void ndisc_recv_ns(struct sk_buff *skb)
> goto out;
> }
> }
First, you do looped packet detection for all packets, not just DAD.
> - addrconf_dad_failure(ifp);
> - return;
> +
> + /* The one exception to the above rule about
> + optimistic addresses is that we need to always
> + respond to an NS from a unicast address if we are
> + optimistic. RFC 4429 Sec 3.3. If (unicast
> + and optimistic) are false then we can just fail
> + dad now.
> + */
> + if (ifp->flags & IFA_F_OPTIMISTIC) {
> + type = ipv6_addr_type(saddr);
> + if (!(type & IPV6_ADDR_UNICAST)) {
> + addrconf_dad_failure(ifp);
> + goto out;
> + }
> + } else
> + if (!dad)
> + goto out;
Second, you fail dad in the OPTIMISTIC case, but not the regular case, which should also fail
if this is a DAD packet.
I think the following is what you want (totally untested):
if (ifp->flags & (IFA_F_TENTATIVE|IFA_F_OPTIMISTIC)) {
if (dad) {
/* We are processing a DAD packet for a tentative address.
* Make sure that this was not one of our NSs looped back
* to us.
*/
if (dev->type== ARPHDR_IEEE802_TR) {
..... blah ...
}
/* Fail DAD since we are colliding with someout out there*/
addrconf_dad_failure(ifp);
} else {
/* This is not a DAD neighbor solicitation. If we
* are OPTIMISTIC, we'll respond with a NA. Otherwise
* we'll ignore the packet.
*/
if (!(ifp->flags & IFA_F_OPTIMISTIC))
goto out
}
}
idef = ifp->idev;
-vlad
next prev parent reply other threads:[~2007-01-22 20:25 UTC|newest]
Thread overview: 71+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-19 21:23 [PATCH] IPv6: Implement RFC 4429 Optimistic Duplicate Address Detection Neil Horman
2007-01-19 23:05 ` YOSHIFUJI Hideaki / 吉藤英明
2007-01-20 1:41 ` Neil Horman
2007-01-22 18:15 ` Neil Horman
2007-01-22 18:39 ` Mika Penttilä
2007-01-22 19:45 ` Neil Horman
2007-01-22 20:25 ` Vlad Yasevich [this message]
2007-01-23 18:36 ` Neil Horman
2007-01-23 19:27 ` Vlad Yasevich
2007-01-23 0:18 ` YOSHIFUJI Hideaki / 吉藤英明
2007-01-23 20:51 ` Neil Horman
2007-01-25 1:54 ` Sridhar Samudrala
2007-01-25 13:33 ` Neil Horman
2007-01-25 17:16 ` Vlad Yasevich
2007-01-25 19:45 ` Neil Horman
2007-01-25 20:18 ` Vlad Yasevich
2007-01-25 21:26 ` Neil Horman
2007-01-25 22:13 ` Vlad Yasevich
2007-01-26 14:27 ` Neil Horman
2007-01-26 15:44 ` YOSHIFUJI Hideaki / 吉藤英明
2007-01-26 19:03 ` Neil Horman
2007-01-25 22:34 ` Vlad Yasevich
2007-01-26 0:13 ` YOSHIFUJI Hideaki / 吉藤英明
2007-01-26 14:20 ` Vlad Yasevich
2007-01-26 19:18 ` Neil Horman
2007-01-26 20:28 ` Vlad Yasevich
2007-01-26 21:35 ` Neil Horman
2007-01-26 21:42 ` Vlad Yasevich
2007-01-29 16:34 ` Neil Horman
2007-01-29 21:30 ` Neil Horman
2007-01-29 22:25 ` YOSHIFUJI Hideaki / 吉藤英明
2007-01-30 13:02 ` Neil Horman
2007-01-30 16:16 ` YOSHIFUJI Hideaki / 吉藤英明
2007-01-31 20:54 ` Neil Horman
2007-02-02 19:06 ` Neil Horman
2007-02-02 19:46 ` David Miller
2007-02-02 20:13 ` Neil Horman
2007-02-02 22:22 ` Vlad Yasevich
2007-02-03 15:06 ` Neil Horman
2007-02-02 21:28 ` Brian Haley
2007-02-02 22:05 ` Vlad Yasevich
2007-02-02 23:57 ` Brian Haley
2007-02-03 15:05 ` Neil Horman
2007-02-05 17:33 ` Brian Haley
2007-02-05 18:37 ` Neil Horman
2007-02-02 21:50 ` Vlad Yasevich
2007-02-03 15:03 ` Neil Horman
[not found] ` <20070205205651.GB484@hmsreliant.homelinux.net>
2007-02-06 1:24 ` YOSHIFUJI Hideaki / 吉藤英明
2007-02-06 1:32 ` David Miller
2007-02-06 1:44 ` YOSHIFUJI Hideaki / 吉藤英明
2007-02-06 1:43 ` David Miller
2007-02-06 12:51 ` Neil Horman
2007-02-06 20:09 ` Neil Horman
2007-02-06 21:13 ` Vlad Yasevich
2007-02-07 20:55 ` Neil Horman
2007-02-07 21:19 ` Vlad Yasevich
2007-02-07 21:52 ` YOSHIFUJI Hideaki / 吉藤英明
2007-02-08 13:07 ` Neil Horman
2007-02-12 23:27 ` YOSHIFUJI Hideaki / 吉藤英明
2007-02-13 18:22 ` Neil Horman
2007-02-07 22:26 ` YOSHIFUJI Hideaki / 吉藤英明
2007-02-08 16:41 ` Neil Horman
2007-02-08 17:10 ` YOSHIFUJI Hideaki / 吉藤英明
2007-02-08 19:32 ` Neil Horman
2007-02-12 21:20 ` Neil Horman
2007-02-13 20:45 ` Neil Horman
2007-02-13 21:46 ` YOSHIFUJI Hideaki / 吉藤英明
2007-02-13 21:53 ` David Miller
[not found] ` <20070221.040259.60395625.yoshfuji@linux-ipv6.org>
[not found] ` <20070221.000222.71087924.davem@davemloft.net>
2007-02-21 8:15 ` YOSHIFUJI Hideaki / 吉藤英明
2007-02-21 9:30 ` David Miller
2007-02-21 13:37 ` Neil Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45B51DC3.1010303@hp.com \
--to=vladislav.yasevich@hp.com \
--cc=davem@davemloft.net \
--cc=jmorris@namei.org \
--cc=kaber@coreworks.de \
--cc=kuznet@ms2.inr.ac.ru \
--cc=mika.penttila@kolumbus.fi \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=pekkas@netcore.fi \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.