]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Linux: Care about the return of setsockopt
authorRoy Marples <roy@marples.name>
Tue, 23 Jul 2019 13:31:07 +0000 (14:31 +0100)
committerRoy Marples <roy@marples.name>
Tue, 23 Jul 2019 13:31:07 +0000 (14:31 +0100)
src/if-linux.c

index 88060c9ba74da866f4c5d0ece53aa53a8f8d7d87..cede7237609da45ccd518e37412b7a89de28c7ae 100644 (file)
@@ -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)