Skip to contentSkip to conversation

ipv4 addr: Send netlink notification for address label changes

PATCH Applied Thomas Graf 2 participants 2 messages Jun 5, 2008 – Jun 10, 2008

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

PATCH 1/1 ipv4 addr: Send netlink notification for address label changes

Makes people happy who try to keep a list of addresses up to date by listening to notifications.

net/ipv4/devinet.c +3 -1
Index: net-2.6/net/ipv4/devinet.c
===================================================================
@@ -1013,7 +1013,7 @@
 		memcpy(old, ifa->ifa_label, IFNAMSIZ);
 		memcpy(ifa->ifa_label, dev->name, IFNAMSIZ);
 		if (named++ == 0)
-			continue;
+			goto skip;
 		dot = strchr(old, ':');
 		if (dot == NULL) {
 			sprintf(old, ":%d", named);
@@ -1024,6 +1024,8 @@
 		} else {
 			strcpy(ifa->ifa_label + (IFNAMSIZ - strlen(dot) - 1), dot);
 		}
+skip:
+		rtmsg_ifa(RTM_NEWADDR, ifa, NULL, 0);
 	}
 }