Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 81979
b: refs/heads/master
c: 7b21857
h: refs/heads/master
i:
  81977: 998dc4a
  81975: 9891471
v: v3
  • Loading branch information
Denis V. Lunev authored and David S. Miller committed Feb 1, 2008
1 parent 6c491ce commit dc45756
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dce5cbeec32eb5db4d406b732b1256c6f702bde5
refs/heads/master: 7b2185747c32260a3e43b94812e96d22a8725f09
21 changes: 8 additions & 13 deletions trunk/net/ipv4/devinet.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,39 +492,34 @@ static struct in_ifaddr *rtm_to_ifaddr(struct nlmsghdr *nlh)
struct ifaddrmsg *ifm;
struct net_device *dev;
struct in_device *in_dev;
int err = -EINVAL;
int err;

err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, ifa_ipv4_policy);
if (err < 0)
goto errout;

ifm = nlmsg_data(nlh);
if (ifm->ifa_prefixlen > 32 || tb[IFA_LOCAL] == NULL) {
err = -EINVAL;
err = -EINVAL;
if (ifm->ifa_prefixlen > 32 || tb[IFA_LOCAL] == NULL)
goto errout;
}

dev = __dev_get_by_index(&init_net, ifm->ifa_index);
if (dev == NULL) {
err = -ENODEV;
err = -ENODEV;
if (dev == NULL)
goto errout;
}

in_dev = __in_dev_get_rtnl(dev);
if (in_dev == NULL) {
err = -ENOBUFS;
err = -ENOBUFS;
if (in_dev == NULL)
goto errout;
}

ifa = inet_alloc_ifa();
if (ifa == NULL) {
if (ifa == NULL)
/*
* A potential indev allocation can be left alive, it stays
* assigned to its device and is destroy with it.
*/
err = -ENOBUFS;
goto errout;
}

ipv4_devconf_setall(in_dev);
in_dev_hold(in_dev);
Expand Down

0 comments on commit dc45756

Please sign in to comment.