aboutsummaryrefslogtreecommitdiff
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorVeaceslav Falico <[email protected]>2014-07-17 20:33:32 +0200
committerDavid S. Miller <[email protected]>2014-07-20 20:44:25 -0700
commit6fe82a39e583a50f28f03b294df79c9de9ec0de4 (patch)
treed6571b3ab0d392a92e9012053eacd0848b783787 /net/core/dev.c
parent4ec6837804e4a0e096930f9d989952cb081eae2f (diff)
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" <[email protected]> CC: Eric Dumazet <[email protected]> CC: Vlad Yasevich <[email protected]> CC: stephen hemminger <[email protected]> CC: Jerry Chu <[email protected]> CC: Ben Hutchings <[email protected]> CC: David Laight <[email protected]> Signed-off-by: Veaceslav Falico <[email protected]> Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 81d61014fd9b..e52a3788d18d 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1113,6 +1113,9 @@ int dev_change_name(struct net_device *dev, const char *newname)
return err;
}
+ if (oldname[0] && !strchr(oldname, '%'))
+ netdev_info(dev, "renamed from %s\n", oldname);
+
old_assign_type = dev->name_assign_type;
dev->name_assign_type = NET_NAME_RENAMED;