mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
c5ec514016
commit
573bf470e6
1 changed files with 3 additions and 1 deletions
|
@ -1013,7 +1013,7 @@ static void inetdev_changename(struct net_device *dev, struct in_device *in_dev)
|
||||||
memcpy(old, ifa->ifa_label, IFNAMSIZ);
|
memcpy(old, ifa->ifa_label, IFNAMSIZ);
|
||||||
memcpy(ifa->ifa_label, dev->name, IFNAMSIZ);
|
memcpy(ifa->ifa_label, dev->name, IFNAMSIZ);
|
||||||
if (named++ == 0)
|
if (named++ == 0)
|
||||||
continue;
|
goto skip;
|
||||||
dot = strchr(old, ':');
|
dot = strchr(old, ':');
|
||||||
if (dot == NULL) {
|
if (dot == NULL) {
|
||||||
sprintf(old, ":%d", named);
|
sprintf(old, ":%d", named);
|
||||||
|
@ -1024,6 +1024,8 @@ static void inetdev_changename(struct net_device *dev, struct in_device *in_dev)
|
||||||
} else {
|
} else {
|
||||||
strcpy(ifa->ifa_label + (IFNAMSIZ - strlen(dot) - 1), dot);
|
strcpy(ifa->ifa_label + (IFNAMSIZ - strlen(dot) - 1), dot);
|
||||||
}
|
}
|
||||||
|
skip:
|
||||||
|
rtmsg_ifa(RTM_NEWADDR, ifa, NULL, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue