diff options
| author | Sebastien Bacher <seb128@ubuntu.com> | 2018-12-10 21:58:18 +0100 |
|---|---|---|
| committer | Sebastien Bacher <seb128@ubuntu.com> | 2018-12-10 21:58:18 +0100 |
| commit | 227c401a10a930af6fd5f123aef345fcd130d6aa (patch) | |
| tree | bf992585295f2c1772ddb0db54569b6d22f36642 /src/ndisc/nm-lndp-ndisc.c | |
| parent | e126f3e804c35480c4f075777430419d6ece23da (diff) | |
Import Upstream version 1.12.6
Diffstat (limited to 'src/ndisc/nm-lndp-ndisc.c')
| -rw-r--r-- | src/ndisc/nm-lndp-ndisc.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/ndisc/nm-lndp-ndisc.c b/src/ndisc/nm-lndp-ndisc.c index c0a0cd40..e1003ad1 100644 --- a/src/ndisc/nm-lndp-ndisc.c +++ b/src/ndisc/nm-lndp-ndisc.c @@ -221,10 +221,10 @@ receive_ra (struct ndp *ndp, struct ndp_msg *msg, gpointer user_data) .preferred = ndp_msg_opt_prefix_preferred_time (msg, offset), }; - if (address.preferred > address.lifetime) - address.preferred = address.lifetime; - if (nm_ndisc_complete_and_add_address (ndisc, &address)) - changed |= NM_NDISC_CONFIG_ADDRESSES; + if (address.preferred <= address.lifetime) { + if (nm_ndisc_complete_and_add_address (ndisc, &address, now)) + changed |= NM_NDISC_CONFIG_ADDRESSES; + } } } ndp_msg_opt_for_each_offset(offset, msg, NDP_MSG_OPT_ROUTE) { @@ -491,13 +491,17 @@ receive_rs (struct ndp *ndp, struct ndp_msg *msg, gpointer user_data) static gboolean event_ready (GIOChannel *source, GIOCondition condition, NMNDisc *ndisc) { + _nm_unused gs_unref_object NMNDisc *ndisc_keep_alive = g_object_ref (ndisc); nm_auto_pop_netns NMPNetns *netns = NULL; NMLndpNDiscPrivate *priv = NM_LNDP_NDISC_GET_PRIVATE ((NMLndpNDisc *) ndisc); _LOGD ("processing libndp events"); - if (!nm_ndisc_netns_push (ndisc, &netns)) - return G_SOURCE_CONTINUE; + if (!nm_ndisc_netns_push (ndisc, &netns)) { + /* something is very wrong. Stop handling events. */ + priv->event_id = 0; + return G_SOURCE_REMOVE; + } ndp_callall_eventfd_handler (priv->ndp); return G_SOURCE_CONTINUE; |