]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
kernel-netlink: Explicitly ignore the result of setsockopt()
authorTobias Brunner <tobias@strongswan.org>
Thu, 22 Dec 2022 11:55:05 +0000 (12:55 +0100)
committerTobias Brunner <tobias@strongswan.org>
Thu, 22 Dec 2022 18:03:37 +0000 (19:03 +0100)
src/libcharon/plugins/kernel_netlink/kernel_netlink_shared.c

index 95cb00f4c292de980cfeb09de00b316b0a0ab3f7..9b70705394ae4e513dfaebb368f421385c189734 100644 (file)
@@ -662,9 +662,11 @@ netlink_socket_t *netlink_socket_create(int protocol, enum_name_t *names,
 
        /* don't echo back the request payload in error messages, might not be
         * supported by older kernels, so don't check the result */
-       setsockopt(this->socket, SOL_NETLINK, NETLINK_CAP_ACK, &on, sizeof(on));
+       ignore_result(setsockopt(this->socket, SOL_NETLINK, NETLINK_CAP_ACK, &on,
+                                                        sizeof(on)));
        /* enable extended ACK attributes, might not be supported by older kernels */
-       setsockopt(this->socket, SOL_NETLINK, NETLINK_EXT_ACK, &on, sizeof(on));
+       ignore_result(setsockopt(this->socket, SOL_NETLINK, NETLINK_EXT_ACK, &on,
+                                                        sizeof(on)));
 
        rcvbuf_size = lib->settings->get_int(lib->settings,
                                                "%s.plugins.kernel-netlink.receive_buffer_size",