• Mark McLoughlin's avatar
    [INET]: Fix netdev renaming and inet address labels · 44344b2a
    Mark McLoughlin authored
    When re-naming an interface, the previous secondary address
    labels get lost e.g.
    
      $> brctl addbr foo
      $> ip addr add 192.168.0.1 dev foo
      $> ip addr add 192.168.0.2 dev foo label foo:00
      $> ip addr show dev foo | grep inet
        inet 192.168.0.1/32 scope global foo
        inet 192.168.0.2/32 scope global foo:00
      $> ip link set foo name bar
      $> ip addr show dev bar | grep inet
        inet 192.168.0.1/32 scope global bar
        inet 192.168.0.2/32 scope global bar:2
    
    Turns out to be a simple thinko in inetdev_changename() - clearly we
    want to look at the address label, rather than the device name, for
    a suffix to retain.
    Signed-off-by: default avatarMark McLoughlin <markmc@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    44344b2a
devinet.c 37.1 KB