netdev
[Top] [All Lists]

ndisc_send_ns: always use link-local addr of the leaving device

To: netdev@xxxxxxxxxxx
Subject: ndisc_send_ns: always use link-local addr of the leaving device
From: Moter Du <Moter_Du@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 14 Feb 2001 18:51:30 +0800
Sender: owner-netdev@xxxxxxxxxxx

Patch in ndisc.c, function ndisc_send_ns;
Without the patch, the following scenario illustrates how it violates RFC2461 :

               Link0
      +---------------------+
      |eth0                 |eth0
[Test Node]        [Router Under Test]
      |eth1                 |eth1
      +---------------------+
               Link1

- At [Test Node] interface eth0, ping global-unicast address of eth1 of [Router Under Test]
- [Router Under Test] will perform NS for address resolution on Link0

Without the patch:
  NS contains global-unicast address of eth1 of [RUT] as Source Address (ERROR!!)
With the patch:
  NS contains link-local address of eth0 of [RUT] as Source Address


--- linux-2.4.0-ORIG/net/ipv6/ndisc.c  Wed Nov 29 13:53:45 2000
+++ linux-2.4.0/net/ipv6/ndisc.c Mon Feb 12 13:32:48 2001
@@ -403,13 +407,18 @@
      return;
   }
                                                                               
-  if (saddr == NULL) {
+// MWI: 20010212:
+// - Force Neighbour Solicitation always use link-local Source Address
+//   of the leaving device, because here 'saddr' may be belong to other devices
+//   thus using it violates RFC2461.
+//
+//   if (saddr == NULL) {
      if (ipv6_get_lladdr(dev, &addr_buf)) {
         kfree_skb(skb);
         return;
      }
      saddr = &addr_buf;
-  }
+//   }
                                                                               
   if (ndisc_build_ll_hdr(skb, dev, daddr, neigh, len) == 0) {
      kfree_skb(skb);




      Sincerely
      Moter Du

      ============================================================
      Moter Du                                  D410, Siemens STSL
      phone   +886 2 25186011
      Fax     +886 2 25053866
      mailto:moter_du@xxxxxxxxxxxxxxxxxxx
      ============================================================

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