From: Don Law <opendon@donlaw.com>
To: yoshfuji@linux-ipv6.org
Cc: opendon@donlaw.com, davem@davemloft.net, kuznet@ms2.inr.ac.ru,
pekkas@netcore.fi, jmorris@namei.org, kaber@coreworks.de,
linux-kernel@vger.kernel.org
Subject: [PATCH linux-2.6.17-rc1] net: fix neigh_delete to handle mult. tables
Date: Thu Apr 13 23:42:09 EDT 2006 -0400 [thread overview]
Message-ID: <p06210202beea43ef060b@[192.168.1.96]> (raw)
I'm resending the patch I just sent. Sorry - it looks like my
mailer likes to damage the white space in the patch.
This version should be cleaner:
Signed-off-by: Don Law <opendon@donlaw.com>
--- linux-2.6.17-rc1/net/core/neighbour.c.orig 2006-04-11 16:28:10.000000000 -0400
+++ linux-2.6.17-rc1/net/core/neighbour.c 2006-04-26 23:36:04.535992104 -0400
@@ -1430,48 +1430,55 @@ int neigh_delete(struct sk_buff *skb, st
struct rtattr **nda = arg;
struct neigh_table *tbl;
struct net_device *dev = NULL;
- int err = -ENODEV;
+ int err;
if (ndm->ndm_ifindex &&
- (dev = dev_get_by_index(ndm->ndm_ifindex)) == NULL)
- goto out;
+ (dev = dev_get_by_index(ndm->ndm_ifindex)) == NULL)
+ return -ENODEV;
read_lock(&neigh_tbl_lock);
- for (tbl = neigh_tables; tbl; tbl = tbl->next) {
+ for (tbl = neigh_tables; ; tbl = tbl->next) {
struct rtattr *dst_attr = nda[NDA_DST - 1];
struct neighbour *n;
+ if (!tbl) {
+ read_unlock(&neigh_tbl_lock);
+ err = -EADDRNOTAVAIL;
+ break;
+ }
if (tbl->family != ndm->ndm_family)
continue;
- read_unlock(&neigh_tbl_lock);
err = -EINVAL;
- if (!dst_attr || RTA_PAYLOAD(dst_attr) < tbl->key_len)
- goto out_dev_put;
+ if (!dst_attr || RTA_PAYLOAD(dst_attr) < tbl->key_len) {
+ read_unlock(&neigh_tbl_lock);
+ break;
+ }
if (ndm->ndm_flags & NTF_PROXY) {
- err = pneigh_delete(tbl, RTA_DATA(dst_attr), dev);
- goto out_dev_put;
+ if (!pneigh_delete(tbl, RTA_DATA(dst_attr), dev)) {
+ read_unlock(&neigh_tbl_lock);
+ break;
+ }
}
- if (!dev)
- goto out;
+ if (!dev) {
+ read_unlock(&neigh_tbl_lock);
+ break;
+ }
n = neigh_lookup(tbl, RTA_DATA(dst_attr), dev);
if (n) {
- err = neigh_update(n, NULL, NUD_FAILED,
+ read_unlock(&neigh_tbl_lock);
+ err = neigh_update(n, NULL, NUD_FAILED,
NEIGH_UPDATE_F_OVERRIDE|
NEIGH_UPDATE_F_ADMIN);
neigh_release(n);
+ break;
}
- goto out_dev_put;
}
- read_unlock(&neigh_tbl_lock);
- err = -EADDRNOTAVAIL;
-out_dev_put:
if (dev)
dev_put(dev);
-out:
return err;
}
next reply other threads:[~2006-04-28 3:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-14 3:42 Don Law [this message]
2006-04-21 3:31 Don Law
2006-04-21 3:55 ` YOSHIFUJI Hideaki / 吉藤英明
2006-04-21 4:20 ` YOSHIFUJI Hideaki / 吉藤英明
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='p06210202beea43ef060b@[192.168.1.96]' \
--to=opendon@donlaw.com \
--cc=davem@davemloft.net \
--cc=jmorris@namei.org \
--cc=kaber@coreworks.de \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®