summaryrefslogtreecommitdiff
path: root/src/libsystemd-network
diff options
context:
space:
mode:
authorSusant Sahani <susant@redhat.com>2018-06-13 19:22:34 +0530
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-06-13 17:14:47 +0200
commit6f8a8b84f28be7a6133bbde1479dee9abad6cee8 (patch)
tree0cfc5fa6e9ccf24aece71eaa6c6ee4e1cbfb9a91 /src/libsystemd-network
parentcb8770ed2137c509f2b73af33619fa0168d727e3 (diff)
downloadsystemd-6f8a8b84f28be7a6133bbde1479dee9abad6cee8.tar.gz
networkd: Don't try to close fd in sd_radv_stop if fd is closed.
sd_radv_stop is called from two places. if sd_radv_stop is alrady success then just don't try to close it . ``` systemd-networkd[604]: RADV: Stopping IPv6 Router Advertisement daemon systemd-networkd[604]: RADV: Unable to send last Router Advertisement with router lifetime set to zero: Bad file descriptor <==================HERE systemd-networkd[604]: RADV: Updated prefix 2a0a:*:*:fc::/64 preferred 1h valid 2h systemd-networkd[604]: RADV: Started IPv6 Router Advertisement daemon ``` Closes one of the issue #8960
Diffstat (limited to 'src/libsystemd-network')
-rw-r--r--src/libsystemd-network/sd-radv.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libsystemd-network/sd-radv.c b/src/libsystemd-network/sd-radv.c
index f349384e7e..cf7fe0997b 100644
--- a/src/libsystemd-network/sd-radv.c
+++ b/src/libsystemd-network/sd-radv.c
@@ -352,6 +352,9 @@ _public_ int sd_radv_stop(sd_radv *ra) {
assert_return(ra, -EINVAL);
+ if (ra->state == SD_RADV_STATE_IDLE)
+ return 0;
+
log_radv("Stopping IPv6 Router Advertisement daemon");
/* RFC 4861, Section 6.2.5, send at least one Router Advertisement