Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tcp: Add a stub for sk_defer_free_flush()

When compiling the kernel with CONFIG_INET disabled, the
sk_defer_free_flush() should be defined as a nop.

This resolves the following compilation error:
ld: net/core/sock.o: in function `sk_defer_free_flush':
./include/net/tcp.h:1378: undefined reference to `__sk_defer_free_flush'

Fixes: 79074a72d335 ("net: Flush deferred skb free on socket destroy")
Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20220120123440.9088-1-gal@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Gal Pressman and committed by
Jakub Kicinski
48cec899 cbda1b16

+4
+4
include/net/tcp.h
··· 1369 1369 1370 1370 bool tcp_add_backlog(struct sock *sk, struct sk_buff *skb); 1371 1371 1372 + #ifdef CONFIG_INET 1372 1373 void __sk_defer_free_flush(struct sock *sk); 1373 1374 1374 1375 static inline void sk_defer_free_flush(struct sock *sk) ··· 1378 1377 return; 1379 1378 __sk_defer_free_flush(sk); 1380 1379 } 1380 + #else 1381 + static inline void sk_defer_free_flush(struct sock *sk) {} 1382 + #endif 1381 1383 1382 1384 int tcp_filter(struct sock *sk, struct sk_buff *skb); 1383 1385 void tcp_set_state(struct sock *sk, int state);