From 74645e05ecb66d876dc7669df6e8f17c95679845 Mon Sep 17 00:00:00 2001 From: flu0r1ne Date: Mon, 2 Oct 2023 18:10:43 -0500 Subject: [PATCH] Annotate `set_privileged_socket_opt` with UNUSED The `set_privileged_socket_opt` function is currently called only when `SO_MARK` or `SO_BINDTODEVICE` are defined. On systems that do not support either feature, `set_privileged_socket_opt` is expected to be unused. Adding an annotation suppresses compiler warnings. --- packet/construct_unix.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packet/construct_unix.c b/packet/construct_unix.c index 8df9997..0d3b1f2 100644 --- a/packet/construct_unix.c +++ b/packet/construct_unix.c @@ -294,21 +294,19 @@ int construct_udp6_packet( typedef cap_value_t mayadd_cap_value_t; #define MAYADD_CAP_NET_RAW CAP_NET_RAW #define MAYADD_CAP_NET_ADMIN CAP_NET_ADMIN -#define MAYADD_UNUSED #else /* ifdef HAVE_LIBCAP */ typedef int mayadd_cap_value_t; #define MAYADD_CAP_NET_RAW ((mayadd_cap_value_t) 0) #define MAYADD_CAP_NET_ADMIN ((mayadd_cap_value_t) 0) -#define MAYADD_UNUSED UNUSED #endif /* ifdef HAVE_LIBCAP */ -static +UNUSED static int set_privileged_socket_opt(int socket, int option_name, void const * option_value, socklen_t option_len, - MAYADD_UNUSED mayadd_cap_value_t required_cap) { + UNUSED mayadd_cap_value_t required_cap) { int result = -1;