Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: print a notification on device rename

Currently it's done silently (from the kernel part), and thus it might be
hard to track the renames from logs.

Add a simple netdev_info() to notify the rename, but only in case the
previous name was valid.

CC: "David S. Miller" <davem@davemloft.net>
CC: Eric Dumazet <edumazet@google.com>
CC: Vlad Yasevich <vyasevic@redhat.com>
CC: stephen hemminger <stephen@networkplumber.org>
CC: Jerry Chu <hkchu@google.com>
CC: Ben Hutchings <bhutchings@solarflare.com>
CC: David Laight <David.Laight@ACULAB.COM>
Signed-off-by: Veaceslav Falico <vfalico@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Veaceslav Falico and committed by
David S. Miller
6fe82a39 4ec68378

+3
+3
net/core/dev.c
··· 1113 1113 return err; 1114 1114 } 1115 1115 1116 + if (oldname[0] && !strchr(oldname, '%')) 1117 + netdev_info(dev, "renamed from %s\n", oldname); 1118 + 1116 1119 old_assign_type = dev->name_assign_type; 1117 1120 dev->name_assign_type = NET_NAME_RENAMED; 1118 1121