Skip to contentSkip to conversation

ipv4: loopback device: ignore value changes after device is upped

PATCH In review Jiri Pirko 2 participants 2 messages Jan 7, 2014

Subsystems (3)
lore
Share & tools
lore

Jiri Pirko

author
#0 lore raw

PATCH 1/1 ipv4: loopback device: ignore value changes after device is upped

When lo is brought up, new ifa is created. Then, devconf and neigh values bitfield should be set so later changes of default values would not affect lo values.

Note that the same behaviour is in ipv6. Also note that this is likely not an issue in many distros (for example Fedora 19) because userspace sets address to lo manually before bringing it up.

---
 net/ipv4/devinet.c | 2 ++
 1 file changed, 2 insertions(+)
net/ipv4/devinet.c +2 -0
index 0feebd5..9809f7b 100644
@@ -1385,6 +1385,8 @@ static int inetdev_event(struct notifier_block *this, unsigned long event,
 				memcpy(ifa->ifa_label, dev->name, IFNAMSIZ);
 				set_ifa_lifetime(ifa, INFINITY_LIFE_TIME,
 						 INFINITY_LIFE_TIME);
+				ipv4_devconf_setall(in_dev);
+				neigh_parms_data_state_setall(in_dev->arp_parms);
 				inet_insert_ifa(ifa);
 			}
 		}
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw

From: Jiri Pirko <[email protected]>
Date: Tue, 7 Jan 2014 15:55:45 +0100

Quoted 9 lines

When lo is brought up, new ifa is created. Then, devconf and neigh values bitfield should be set so later changes of default values would not affect lo values.

Note that the same behaviour is in ipv6. Also note that this is likely not an issue in many distros (for example Fedora 19) because userspace sets address to lo manually before bringing it up.

Looks good, applied.