From: Roy Marples Date: Tue, 23 Jul 2019 13:31:07 +0000 (+0100) Subject: Linux: Care about the return of setsockopt X-Git-Tag: v8.0.0~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6c7e8b7255dfef273b7d889433d0dbee2ca664b;p=thirdparty%2Fdhcpcd.git Linux: Care about the return of setsockopt --- diff --git a/src/if-linux.c b/src/if-linux.c index 88060c9b..cede7237 100644 --- a/src/if-linux.c +++ b/src/if-linux.c @@ -320,8 +320,9 @@ if_opensockets_os(struct dhcpcd_ctx *ctx) if (ctx->link_fd == -1) return -1; #ifdef NETLINK_BROADCAST_ERROR - setsockopt(ctx->link_fd, SOL_NETLINK, NETLINK_BROADCAST_ERROR, - &on, sizeof(on)); + if (setsockopt(ctx->link_fd, SOL_NETLINK, NETLINK_BROADCAST_ERROR, + &on, sizeof(on)) == -1) + return -1; #endif if ((priv = calloc(1, sizeof(*priv))) == NULL)