* [PATCH][IPV4] Swap the ifa allocation with the"ipv4_devconf_setall" call
@ 2007-12-07 9:22 Pavel Emelyanov
2007-12-08 7:55 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Pavel Emelyanov @ 2007-12-07 9:22 UTC (permalink / raw)
To: David Miller; +Cc: Herbert Xu, Linux Netdev List, devel
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>
---
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 0b5f042..1c3e20c 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -519,8 +519,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) {
/*
@@ -531,6 +529,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)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH][IPV4] Swap the ifa allocation with the"ipv4_devconf_setall" call
2007-12-07 9:22 [PATCH][IPV4] Swap the ifa allocation with the"ipv4_devconf_setall" call Pavel Emelyanov
@ 2007-12-08 7:55 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2007-12-08 7:55 UTC (permalink / raw)
To: xemul; +Cc: herbert, netdev, devel
From: Pavel Emelyanov <xemul@openvz.org>
Date: Fri, 07 Dec 2007 12:22:57 +0300
> 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>
Applied to net-2.6, thanks Pavel.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-12-08 7:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-07 9:22 [PATCH][IPV4] Swap the ifa allocation with the"ipv4_devconf_setall" call Pavel Emelyanov
2007-12-08 7:55 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).