From: Aleš Mrázek Date: Fri, 22 Aug 2025 12:42:26 +0000 (+0200) Subject: lint: daemon/network.c: replaced NULL argument for 'setsockopt' X-Git-Tag: v6.0.16~19^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3d18ffeddae6e5f177145c635f1dff17c38ebae;p=thirdparty%2Fknot-resolver.git lint: daemon/network.c: replaced NULL argument for 'setsockopt' The 4th argument to 'setsockopt' should not be NULL, clang-tidy clang-analyzer-unix.StdCLibraryFunctions error. --- diff --git a/daemon/network.c b/daemon/network.c index 9bedfc929..d4088bbaa 100644 --- a/daemon/network.c +++ b/daemon/network.c @@ -919,7 +919,8 @@ static int clear_bpf_cb(trie_val_t *val, void *ctx) uv_fileno(endpoint->handle, &sockfd); kr_require(sockfd != -1); - if (setsockopt(sockfd, SOL_SOCKET, SO_DETACH_BPF, NULL, 0) != 0) { + int no = 0; + if (setsockopt(sockfd, SOL_SOCKET, SO_DETACH_BPF, &no, sizeof(no)) != 0) { kr_log_error(NETWORK, "failed to clear SO_DETACH_BPF socket option\n"); } /* Proceed even if setsockopt() failed,