netdev
[Top] [All Lists]

[PATCH] [IPV6] NDISC: ensure responding to NS without link-layer informa

To: davem@xxxxxxxxxxxxx
Subject: [PATCH] [IPV6] NDISC: ensure responding to NS without link-layer information.
From: YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@xxxxxxxxxxxxxx>
Date: Thu, 16 Sep 2004 12:59:21 +0900 (JST)
Cc: netdev@xxxxxxxxxxx, yoshfuji@xxxxxxxxxxxxxx
Organization: USAGI Project
Sender: netdev-bounce@xxxxxxxxxxx
Hello.

When sending NA in response to NS, we may not know the 
link-layer address for the destination of the NA 
since unicast NS is not required to include its link-layer information.
In this case, we first need to resolve the link-layer address.
(RFC 2461 7.2.4)

We now create neighbour entry for the destination 
and link-layer information will be automatically solved 
in the output path.

Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@xxxxxxxxxxxxxx>

Also available at <bk://bk.skbuff.net:20609/linux-2.6-ndp-20040916/>.

Thanks.

diff -Nru a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
--- a/net/ipv6/ndisc.c  2004-09-16 12:54:26 +09:00
+++ b/net/ipv6/ndisc.c  2004-09-16 12:54:26 +09:00
@@ -810,7 +810,8 @@
         *      update / create cache entry
         *      for the source address
         */
-       neigh = __neigh_lookup(&nd_tbl, saddr, dev, lladdr || !dev->addr_len);
+       neigh = __neigh_lookup(&nd_tbl, saddr, dev,
+                              !inc || lladdr || !dev->addr_len);
        if (neigh)
                neigh_update(neigh, lladdr, NUD_STALE, 
                             NEIGH_UPDATE_F_WEAK_OVERRIDE|

-- 
Hideaki YOSHIFUJI @ USAGI Project <yoshfuji@xxxxxxxxxxxxxx>
GPG FP: 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA

<Prev in Thread] Current Thread [Next in Thread>