浏览代码

ipv6: Only act upon NETDEV_*_TYPE_CHANGE if we have ipv6 addresses

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>
Andrew Lunn 9 年之前
父节点
当前提交
3ef0952ca8
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      net/ipv6/addrconf.c

+ 2 - 1
net/ipv6/addrconf.c

@@ -3287,7 +3287,8 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
 
 
 	case NETDEV_PRE_TYPE_CHANGE:
 	case NETDEV_PRE_TYPE_CHANGE:
 	case NETDEV_POST_TYPE_CHANGE:
 	case NETDEV_POST_TYPE_CHANGE:
-		addrconf_type_change(dev, event);
+		if (idev)
+			addrconf_type_change(dev, event);
 		break;
 		break;
 	}
 	}