Skip to content

Commit

Permalink
net: print a notification on device rename
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Veaceslav Falico authored and David S. Miller committed Jul 21, 2014
1 parent 4ec6837 commit 6fe82a3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 6fe82a3

Please sign in to comment.