diff options
author | Tom Gundersen <teg@jklm.no> | 2015-10-22 17:34:58 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-10-22 17:34:58 +0200 |
commit | cbe91b3cba3298866f51abfa598c5751e90fd390 (patch) | |
tree | 102fa25c9691276d0fb0f72dc929b9e7860b2f55 | |
parent | 4e5ca364f4f8dadb90ec7cdb7db160dbd3b30966 (diff) |
sd-ndisc: reduce callbacks
Only callback on error when the statemachine is in a truly broken state. This
is now only the case when we fail to rearm a timer.
-rw-r--r-- | src/libsystemd-network/sd-ndisc.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/libsystemd-network/sd-ndisc.c b/src/libsystemd-network/sd-ndisc.c index fd512b5ce4..a361662072 100644 --- a/src/libsystemd-network/sd-ndisc.c +++ b/src/libsystemd-network/sd-ndisc.c @@ -540,11 +540,7 @@ static int ndisc_router_solicitation_timeout(sd_event_source *s, uint64_t usec, nd->nd_sent++; - r = sd_event_now(nd->event, clock_boottime_or_monotonic(), &time_now); - if (r < 0) { - ndisc_notify(nd, r); - return 0; - } + assert_se(sd_event_now(nd->event, clock_boottime_or_monotonic(), &time_now) >= 0); next_timeout = time_now + NDISC_ROUTER_SOLICITATION_INTERVAL; @@ -556,18 +552,13 @@ static int ndisc_router_solicitation_timeout(sd_event_source *s, uint64_t usec, return 0; } - r = sd_event_source_set_priority(nd->timeout, - nd->event_priority); - if (r < 0) { - ndisc_notify(nd, r); + r = sd_event_source_set_priority(nd->timeout, nd->event_priority); + if (r < 0) return 0; - } r = sd_event_source_set_description(nd->timeout, "ndisc-timeout"); - if (r < 0) { - ndisc_notify(nd, r); + if (r < 0) return 0; - } } return 0; |