]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkd: Don't try to close fd in sd_radv_stop if fd is closed.
authorSusant Sahani <susant@redhat.com>
Wed, 13 Jun 2018 13:52:34 +0000 (19:22 +0530)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 13 Jun 2018 15:14:47 +0000 (17:14 +0200)
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

src/libsystemd-network/sd-radv.c

index f349384e7efd2cd6c629007a7b00e71bc6d51296..cf7fe0997b7675ef2abcc06389711318a52d2c3f 100644 (file)
@@ -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