summaryrefslogtreecommitdiffstats
path: root/src/libsystemd-network/sd-lldp-rx.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-09-28 07:55:06 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-09-28 08:07:37 +0200
commitaa3f8d4ca133dbd43598967e68257b5e93789f92 (patch)
tree7683dc1f11bde52929350cc273b0a2d3a18d1d72 /src/libsystemd-network/sd-lldp-rx.c
parentsd-lldp-rx: add comments about the three multicast addresses (diff)
downloadsystemd-aa3f8d4ca133dbd43598967e68257b5e93789f92.tar.xz
systemd-aa3f8d4ca133dbd43598967e68257b5e93789f92.zip
sd-lldp-rx: ensure no event will be triggered after sd_lldp_rx_detach_event() is called
Diffstat (limited to 'src/libsystemd-network/sd-lldp-rx.c')
-rw-r--r--src/libsystemd-network/sd-lldp-rx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libsystemd-network/sd-lldp-rx.c b/src/libsystemd-network/sd-lldp-rx.c
index 21b538a930..54e8dd8779 100644
--- a/src/libsystemd-network/sd-lldp-rx.c
+++ b/src/libsystemd-network/sd-lldp-rx.c
@@ -319,6 +319,8 @@ _public_ int sd_lldp_rx_detach_event(sd_lldp_rx *lldp_rx) {
assert_return(lldp_rx, -EINVAL);
assert_return(!sd_lldp_rx_is_running(lldp_rx), -EBUSY);
+ lldp_rx->io_event_source = sd_event_source_disable_unref(lldp_rx->io_event_source);
+ lldp_rx->timer_event_source = sd_event_source_disable_unref(lldp_rx->timer_event_source);
lldp_rx->event = sd_event_unref(lldp_rx->event);
return 0;
}
@@ -369,7 +371,6 @@ static sd_lldp_rx *lldp_rx_free(sd_lldp_rx *lldp_rx) {
lldp_rx_reset(lldp_rx);
- sd_event_source_unref(lldp_rx->timer_event_source);
sd_lldp_rx_detach_event(lldp_rx);
lldp_rx_flush_neighbors(lldp_rx);