ipv6: Only act upon NETDEV_*_TYPE_CHANGE if we have ipv6 addresses
authorAndrew Lunn <andrew@lunn.ch>
Thu, 3 Dec 2015 20:12:32 +0000 (21:12 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 5 Dec 2015 22:41:42 +0000 (17:41 -0500)
An interface changing type may not have IPv6 addresses. Don't
call the address configuration type change in this case.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/addrconf.c

index 6936d0d8c6b1d4c0778d61ea4f09a44447629e5b..5e9111da449d35a0d7ca24b6202785a9bd831fdb 100644 (file)
@@ -3287,7 +3287,8 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
 
        case NETDEV_PRE_TYPE_CHANGE:
        case NETDEV_POST_TYPE_CHANGE:
-               addrconf_type_change(dev, event);
+               if (idev)
+                       addrconf_type_change(dev, event);
                break;
        }