[cilium:pr/bpf-tproxy 8/8] include/net/request_sock.h:117:26: warning: comparison of distinct pointer types ('void (*)(struct sk_buff *)' and 'void (*)(struct sock *, void *, int)')

kernel test robot
2026-04-16T11:58:48Z

tree: https://github.com/cilium/linux.git pr/bpf-tproxy
head: 27d1eafb8d37f1b272a991077d3bd1bb312118a9
commit: df7aabea1249e933d8d0f5caff085026de1cd217 [8/8] bpf: Support SOCK_RCU_FREE sockets in bpf_sk_assign on egress
config: arm-allnoconfig (https://download.01.org/0day-ci/archive/20260416/202604161920.Uz2i97b3-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 5bac06718f502014fade905512f1d26d578a18f3)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260416/202604161920.Uz2i97b3-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202604161920.Uz2i97b3-lkp@intel.com/

All warnings (new ones prefixed by >>):

In file included from init/do_mounts.c:23:
In file included from include/linux/nfs_fs.h:32:
In file included from include/linux/sunrpc/clnt.h:29:
In file included from include/net/ipv6.h:12:
In file included from include/linux/ipv6.h:103:
In file included from include/linux/tcp.h:20:
In file included from include/net/inet_connection_sock.h:21:
In file included from include/net/inet_sock.h:24:
include/net/request_sock.h:117:29: error: use of undeclared identifier 'sock_pfree_cnt'; did you mean 'sock_kfree_s'?
117 | skb->destructor == sock_pfree_cnt;
| ^~~~~~~~~~~~~~
| sock_kfree_s
include/net/sock.h:1901:6: note: 'sock_kfree_s' declared here
1901 | void sock_kfree_s(struct sock *sk, void *mem, int size);
| ^
In file included from init/do_mounts.c:23:
In file included from include/linux/nfs_fs.h:32:
In file included from include/linux/sunrpc/clnt.h:29:
In file included from include/net/ipv6.h:12:
In file included from include/linux/ipv6.h:103:
In file included from include/linux/tcp.h:20:
In file included from include/net/inet_connection_sock.h:21:
In file included from include/net/inet_sock.h:24:
>> include/net/request_sock.h:117:26: warning: comparison of distinct pointer types ('void (*)(struct sk_buff *)' and 'void (*)(struct sock *, void *, int)') [-Wcompare-distinct-pointer-types]
117 | skb->destructor == sock_pfree_cnt;
| ~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
1 warning and 1 error generated.

vim +117 include/net/request_sock.h

86
87 /**
88 * skb_steal_sock - steal a socket from an sk_buff
89 * @skb: sk_buff to steal the socket from
90 * @refcounted: is set to true if the socket is reference-counted
91 * @prefetched: is set to true if the socket was assigned from bpf
92 */
93 static inline struct sock *skb_steal_sock(struct sk_buff *skb,
94 bool *refcounted, bool *prefetched)
95 {
96 struct sock *sk = skb->sk;
97
98 if (!sk) {
99 *prefetched = false;
100 *refcounted = false;
101 return NULL;
102 }
103
104 *prefetched = skb_sk_is_prefetched(skb);
105 if (*prefetched) {
106 #if IS_ENABLED(CONFIG_SYN_COOKIES)
107 if (sk->sk_state == TCP_NEW_SYN_RECV && inet_reqsk(sk)->syncookie) {
108 struct request_sock *req = inet_reqsk(sk);
109
110 *refcounted = false;
111 sk = req->rsk_listener;
112 req->rsk_listener = NULL;
113 return sk;
114 }
115 #endif
116 *refcounted = sk_is_refcounted(sk) ||
> 117 skb->destructor == sock_pfree_cnt;
118 } else {
119 *refcounted = true;
120 }
121
122 skb->destructor = NULL;
123 skb->sk = NULL;
124 return sk;
125 }
126

--
0-DAY CI Kernel Test Service