From: Roy Marples Date: Fri, 21 Apr 2017 22:21:59 +0000 (+0100) Subject: BSD: if failed to open PF_ROUTE socket, don't set filters. X-Git-Tag: v7.0.0-rc1~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dee3410fadbd1b6d24f2d53a2864ed957b80f891;p=thirdparty%2Fdhcpcd.git BSD: if failed to open PF_ROUTE socket, don't set filters. --- diff --git a/src/if-bsd.c b/src/if-bsd.c index d2f0dc62..addca622 100644 --- a/src/if-bsd.c +++ b/src/if-bsd.c @@ -153,6 +153,8 @@ if_opensockets_os(struct dhcpcd_ctx *ctx) #define SOCK_FLAGS (SOCK_CLOEXEC | SOCK_NONBLOCK) ctx->link_fd = xsocket(PF_ROUTE, SOCK_RAW | SOCK_FLAGS, AF_UNSPEC); #undef SOCK_FLAGS + if (ctx->link_fd == -1) + return -1; #if defined(RO_MSGFILTER) if (setsockopt(ctx->link_fd, PF_ROUTE, RO_MSGFILTER, @@ -168,7 +170,7 @@ if_opensockets_os(struct dhcpcd_ctx *ctx) logerr(__func__); #endif - return ctx->link_fd == -1 ? -1 : 0; + return 0; } void