History

net: ipv6: send NS for DAD when link operationally up

The NS for DAD are sent on admin up as long as a valid qdisc is found. A race condition exists by which these packets will not egress the interface if the operational state of the lower device is not yet up. The solution is to delay DAD until the link is operationally up according to RFC2863. Rather than only doing this, follow the existing code checks by deferring IPv6 device initialization altogether. The fix allows DAD on devices like tunnels that are controlled by userspace control plane. The fix has no impact on regular deployments, but means that there is no IPv6 connectivity until the port has been opened in the case of port-based network access control, which should be desirable.

Mike Manning committed 9 years ago

Commit 1f372c71 parent fa8fefa1 file · +6 −6Browse files

Unified · Split

net/ipv6/addrconf.c+6−6
@@ -303,10 +303,10 @@ static struct ipv6_devconf ipv6_devconf_dflt __read_mostly = { · 302 unmodified lines
303303 .disable_policy = 0,
304304 };
305305
306−/* Check if a valid qdisc is available */
307−static inline bool addrconf_qdisc_ok(const struct net_device *dev)
306+/* Check if link is ready: is it up and is a valid qdisc available */
307+static inline bool addrconf_link_ready(const struct net_device *dev)
308308 {
309− return !qdisc_tx_is_noop(dev);
309+ return netif_oper_up(dev) && !qdisc_tx_is_noop(dev);
310310 }
311311
312312 static void addrconf_del_rs_timer(struct inet6_dev *idev)
@@ -451,7 +451,7 @@ static struct inet6_dev *ipv6_add_dev(struct net_device *dev) · 138 unmodified lines
451451
452452 ndev->token = in6addr_any;
453453
454− if (netif_running(dev) && addrconf_qdisc_ok(dev))
454+ if (netif_running(dev) && addrconf_link_ready(dev))
455455 ndev->if_flags |= IF_READY;
456456
457457 ipv6_mc_init_dev(ndev);
@@ -3403,7 +3403,7 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, · 2945 unmodified lines
34033403 /* restore routes for permanent addresses */
34043404 addrconf_permanent_addr(dev);
34053405
3406− if (!addrconf_qdisc_ok(dev)) {
3406+ if (!addrconf_link_ready(dev)) {
34073407 /* device is not ready yet. */
34083408 pr_info("ADDRCONF(NETDEV_UP): %s: link is not ready\n",
34093409 dev->name);
@@ -3418,7 +3418,7 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, · 8 unmodified lines
34183418 run_pending = 1;
34193419 }
34203420 } else if (event == NETDEV_CHANGE) {
3421− if (!addrconf_qdisc_ok(dev)) {
3421+ if (!addrconf_link_ready(dev)) {
34223422 /* device is still not ready. */
34233423 break;
34243424 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t