From: Veaceslav Falico Date: Thu, 17 Jul 2014 18:33:32 +0000 (+0200) Subject: net: print a notification on device rename X-Git-Tag: firefly_0821_release~176^2~3474^2~124 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6fe82a39e583a50f28f03b294df79c9de9ec0de4;p=firefly-linux-kernel-4.4.55.git 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" CC: Eric Dumazet CC: Vlad Yasevich CC: stephen hemminger CC: Jerry Chu CC: Ben Hutchings CC: David Laight Signed-off-by: Veaceslav Falico Signed-off-by: David S. Miller --- 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;