diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 83a077470..72417afc4 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -1897,10 +1897,8 @@ device_link_changed (NMDevice *self) } if (priv->ndisc && info.inet6_token.id) { - if (nm_ndisc_set_iid (priv->ndisc, info.inet6_token)) { + if (nm_ndisc_set_iid (priv->ndisc, info.inet6_token)) _LOGD (LOGD_DEVICE, "IPv6 tokenized identifier present on device %s", priv->iface); - nm_ndisc_start (priv->ndisc); - } } if (klass->link_changed) diff --git a/src/ndisc/nm-lndp-ndisc.c b/src/ndisc/nm-lndp-ndisc.c index b86aad2cc..d01c128fb 100644 --- a/src/ndisc/nm-lndp-ndisc.c +++ b/src/ndisc/nm-lndp-ndisc.c @@ -323,6 +323,9 @@ start (NMNDisc *ndisc) NMLndpNDiscPrivate *priv = NM_LNDP_NDISC_GET_PRIVATE ((NMLndpNDisc *) ndisc); int fd = ndp_get_eventfd (priv->ndp); + g_return_if_fail (!priv->event_channel); + g_return_if_fail (!priv->event_id); + priv->event_channel = g_io_channel_unix_new (fd); priv->event_id = g_io_add_watch (priv->event_channel, G_IO_IN, (GIOFunc) event_ready, ndisc); diff --git a/src/ndisc/nm-ndisc.c b/src/ndisc/nm-ndisc.c index f78c4fd45..a7f0dd858 100644 --- a/src/ndisc/nm-ndisc.c +++ b/src/ndisc/nm-ndisc.c @@ -531,6 +531,7 @@ nm_ndisc_set_iid (NMNDisc *ndisc, const NMUtilsIPv6IfaceId iid) _LOGD ("IPv6 interface identifier changed, flushing addresses"); g_array_remove_range (rdata->addresses, 0, rdata->addresses->len); _emit_config_change (ndisc, NM_NDISC_CONFIG_ADDRESSES); + solicit (ndisc); } return TRUE; } @@ -556,21 +557,20 @@ nm_ndisc_start (NMNDisc *ndisc) NMNDiscClass *klass = NM_NDISC_GET_CLASS (ndisc); gint64 ra_wait_secs; - g_assert (klass->start); + g_return_if_fail (klass->start); + g_return_if_fail (!priv->ra_timeout_id); _LOGD ("starting neighbor discovery: %d", priv->ifindex); if (!nm_ndisc_netns_push (ndisc, &netns)) return; - nm_clear_g_source (&priv->ra_timeout_id); ra_wait_secs = (((gint64) priv->router_solicitations) * priv->router_solicitation_interval) + 1; ra_wait_secs = CLAMP (ra_wait_secs, 30, 120); priv->ra_timeout_id = g_timeout_add_seconds (ra_wait_secs, ndisc_ra_timeout_cb, ndisc); _LOGD ("scheduling RA timeout in %d seconds", (int) ra_wait_secs); - if (klass->start) - klass->start (ndisc); + klass->start (ndisc); solicit (ndisc); }