All of lore.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: David Miller <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>
Subject: [PATCH] ipv4: Only destroy inet devices when we receive an NETDEV_UNREGISTER event
Date: Fri, 22 Jun 2007 00:42:34 -0600	[thread overview]
Message-ID: <m17ipwebhh.fsf@ebiederm.dsl.xmission.com> (raw)


Currently we destroy inet devices when we remove the last interface
from an inet device, and during NETDEV_UNREGISTER.  We only create
them during NETDEV_REGISTER event.  The result is if you and an ipv4
address to a device delete it (so the device has no ipv4 addresses)
and attampt to add any ipv4 address to that device you will receive 
an -ENOBUFS error.

To correct the problem this patch simply deletes the excess inet
device destroy.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
 net/ipv4/devinet.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index fa97b96..abf6352 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -327,12 +327,8 @@ static void __inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
 		}
 
 	}
-	if (destroy) {
+	if (destroy)
 		inet_free_ifa(ifa1);
-
-		if (!in_dev->ifa_list)
-			inetdev_destroy(in_dev);
-	}
 }
 
 static void inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
-- 
1.5.1.1.181.g2de0


             reply	other threads:[~2007-06-22  6:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-22  6:42 Eric W. Biederman [this message]
2007-06-22  9:07 ` [PATCH] ipv4: Only destroy inet devices when we receive an NETDEV_UNREGISTER event Eric W. Biederman

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=m17ipwebhh.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.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.