]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-lldp-rx: sd_event should be attached when lldp_rx_start_timer() is called
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 28 Sep 2021 06:41:19 +0000 (15:41 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 28 Sep 2021 08:55:19 +0000 (17:55 +0900)
src/libsystemd-network/sd-lldp-rx.c

index af4bd6276259acbe04441cf52316eac92eaac159..05dec99d5106308e626b70c4748ff7e0893bc0d3 100644 (file)
@@ -426,6 +426,7 @@ static int lldp_rx_start_timer(sd_lldp_rx *lldp_rx, sd_lldp_neighbor *neighbor)
         sd_lldp_neighbor *n;
 
         assert(lldp_rx);
+        assert(lldp_rx->event);
 
         if (neighbor)
                 lldp_neighbor_start_ttl(neighbor);
@@ -434,9 +435,6 @@ static int lldp_rx_start_timer(sd_lldp_rx *lldp_rx, sd_lldp_neighbor *neighbor)
         if (!n)
                 return event_source_disable(lldp_rx->timer_event_source);
 
-        if (!lldp_rx->event)
-                return 0;
-
         return event_reset_time(lldp_rx->event, &lldp_rx->timer_event_source,
                                 clock_boottime_or_monotonic(),
                                 n->until, 0,