Skip to content

Commit

Permalink
[IPV4]: Swap the ifa allocation with the"ipv4_devconf_setall" call
Browse files Browse the repository at this point in the history
According to Herbert, the ipv4_devconf_setall should be called
only when the ifa is added to the device. However, failed
ifa allocation may bring things into inconsistent state.

Move the call to ipv4_devconf_setall after the ifa allocation.

Fits both net-2.6 (with offsets) and net-2.6.25 (cleanly).

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Dec 11, 2007
1 parent 1df2e44 commit a4e65d3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/ipv4/devinet.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,6 @@ static struct in_ifaddr *rtm_to_ifaddr(struct nlmsghdr *nlh)
goto errout;
}

ipv4_devconf_setall(in_dev);

ifa = inet_alloc_ifa();
if (ifa == NULL) {
/*
Expand All @@ -528,6 +526,7 @@ static struct in_ifaddr *rtm_to_ifaddr(struct nlmsghdr *nlh)
goto errout;
}

ipv4_devconf_setall(in_dev);
in_dev_hold(in_dev);

if (tb[IFA_ADDRESS] == NULL)
Expand Down

0 comments on commit a4e65d3

Please sign in to comment.