netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@suug.ch>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@oss.sgi.com
Subject: [PATCH] [NET]: Fix deletion of local addresses only varying in prefix length
Date: Fri, 4 Mar 2005 02:20:03 +0100	[thread overview]
Message-ID: <20050304012003.GA31837@postel.suug.ch> (raw)

The deletion of local addresses via netlink doesn't take the
prefix length into account resulting in the deletion of
the address that was added first given multiple addresses
exist only varying in the prefix length.

tgr:axs ~ ip -4 addr show dev lo
1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue 
    inet 127.0.0.1/8 scope host lo
    inet 1.1.1.1/1 scope global lo
    inet 1.1.1.1/2 scope global lo
tgr:axs ~ ip addr del 1.1.1.1/2 dev lo
tgr:axs ~ ip -4 addr show dev lo
1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue 
    inet 127.0.0.1/8 scope host lo
    inet 1.1.1.1/2 scope global lo

Signed-off-by: Thomas Graf <tgraf@suug.ch>

--- linux-2.6.11.orig/net/ipv4/devinet.c	2005-03-04 00:45:05.000000000 +0100
+++ linux-2.6.11/net/ipv4/devinet.c	2005-03-04 01:55:54.000000000 +0100
@@ -396,8 +396,9 @@
 	for (ifap = &in_dev->ifa_list; (ifa = *ifap) != NULL;
 	     ifap = &ifa->ifa_next) {
 		if ((rta[IFA_LOCAL - 1] &&
+		     (ifm->ifa_prefixlen != ifa->ifa_prefixlen ||
 		     memcmp(RTA_DATA(rta[IFA_LOCAL - 1]),
-			    &ifa->ifa_local, 4)) ||
+			    &ifa->ifa_local, 4))) ||
 		    (rta[IFA_LABEL - 1] &&
 		     rtattr_strcmp(rta[IFA_LABEL - 1], ifa->ifa_label)) ||
 		    (rta[IFA_ADDRESS - 1] &&

             reply	other threads:[~2005-03-04  1:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-04  1:20 Thomas Graf [this message]
2005-03-04  8:31 ` [PATCH] [NET]: Fix deletion of local addresses only varying in prefix length Herbert Xu
2005-03-04 13:14   ` Thomas Graf
2005-03-04 20:40     ` Herbert Xu
2005-03-04 20:46       ` Herbert Xu
2005-03-04 23:32     ` Herbert Xu
2005-03-05  0:29       ` Thomas Graf
2005-03-05  0:31         ` Thomas Graf
2005-03-05  0:46         ` Patrick McHardy
2005-03-05  1:03           ` Herbert Xu
2005-03-05  1:11             ` Patrick McHardy
2005-03-05  1:20               ` Thomas Graf
2005-03-05  1:28                 ` Patrick McHardy
2005-03-05  0:59         ` Herbert Xu
2005-03-05 16:23           ` Thomas Graf
2005-03-05 18:30             ` Herbert Xu
2005-03-08 16:01               ` [PATCH] [NET]: Fix deletion of equal local IPv4 " Thomas Graf
2005-03-04 13:30   ` [PATCH] [NET]: Fix deletion of local " Thomas Graf

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=20050304012003.GA31837@postel.suug.ch \
    --to=tgraf@suug.ch \
    --cc=davem@davemloft.net \
    --cc=netdev@oss.sgi.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).