diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2007-12-11 09:39:32 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-12-14 10:32:00 -0800 |
commit | 33b4144db91ddeb74203395d72bcd7bfdeb6c4e6 (patch) | |
tree | d2343be1b2b8f1cbf303a113f545a711f14ca265 | |
parent | cd133a40af7a3607727f58d48e0654ce99e00868 (diff) |
DECNET: dn_nl_deladdr() almost always returns no error
[DECNET]: dn_nl_deladdr() almost always returns no error
[ Upstream commit: 3ccd86241b277249d5ac08e91eddfade47184520 ]
As far as I see from the err variable initialization
the dn_nl_deladdr() routine was designed to report errors
like "EADDRNOTAVAIL" and probaby "ENODEV".
But the code sets this err to 0 after the first nlmsg_parse
and goes on, returning this 0 in any case.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Steven Whitehouse <swhiteho@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | net/decnet/dn_dev.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c index d46e45398da..b51ee151f47 100644 --- a/net/decnet/dn_dev.c +++ b/net/decnet/dn_dev.c @@ -651,16 +651,18 @@ static int dn_nl_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) struct dn_dev *dn_db; struct ifaddrmsg *ifm; struct dn_ifaddr *ifa, **ifap; - int err = -EADDRNOTAVAIL; + int err; err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, dn_ifa_policy); if (err < 0) goto errout; + err = -ENODEV; ifm = nlmsg_data(nlh); if ((dn_db = dn_dev_by_index(ifm->ifa_index)) == NULL) goto errout; + err = -EADDRNOTAVAIL; for (ifap = &dn_db->ifa_list; (ifa = *ifap); ifap = &ifa->ifa_next) { if (tb[IFA_LOCAL] && nla_memcmp(tb[IFA_LOCAL], &ifa->ifa_local, 2)) |