Skip to contentSkip to conversation

Swap the ifa allocation with the"ipv4_devconf_setall" call

PATCH Applied Pavel Emelyanov 2 participants 2 messages Dec 7, 2007 – Dec 8, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Swap the ifa allocation with the"ipv4_devconf_setall" call

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).

---

net/ipv4/devinet.c +1 -2
index 0b5f042..1c3e20c 100644
@@ -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)
maintainer Applied
#1 lore raw

From: Pavel Emelyanov <[email protected]>
Date: Fri, 07 Dec 2007 12:22:57 +0300

Quoted 9 lines

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).

Applied to net-2.6, thanks Pavel.