summaryrefslogtreecommitdiffstats
path: root/zebra/rtadv.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/rtadv.c')
-rw-r--r--zebra/rtadv.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/zebra/rtadv.c b/zebra/rtadv.c
index f9caa85b1..89087a9ec 100644
--- a/zebra/rtadv.c
+++ b/zebra/rtadv.c
@@ -630,23 +630,41 @@ rtadv_make_socket (void)
safe_strerror (errno) );
if (sock < 0)
- return -1;
+ {
+ close (sock);
+ return -1;
+ }
ret = setsockopt_ipv6_pktinfo (sock, 1);
if (ret < 0)
- return ret;
+ {
+ close (sock);
+ return ret;
+ }
ret = setsockopt_ipv6_multicast_loop (sock, 0);
if (ret < 0)
- return ret;
+ {
+ close (sock);
+ return ret;
+ }
ret = setsockopt_ipv6_unicast_hops (sock, 255);
if (ret < 0)
- return ret;
+ {
+ close (sock);
+ return ret;
+ }
ret = setsockopt_ipv6_multicast_hops (sock, 255);
if (ret < 0)
- return ret;
+ {
+ close (sock);
+ return ret;
+ }
ret = setsockopt_ipv6_hoplimit (sock, 1);
if (ret < 0)
- return ret;
+ {
+ close (sock);
+ return ret;
+ }
ICMP6_FILTER_SETBLOCKALL(&filter);
ICMP6_FILTER_SETPASS (ND_ROUTER_SOLICIT, &filter);