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

net: ipv4: Remove extern udp_v4_early_demux()/tcp_v4_early_demux() in .c files

Function udp_v4_early_demux() was already declared in 'include/net/udp.h',
no need to keep the extern in 'ip_input.c', which may produce the
following checkpatch warning:

WARNING: externs should be avoided in .c files
#45: FILE: net/ipv4/ip_input.c:322:
+enum skb_drop_reason udp_v4_early_demux(struct sk_buff *skb);

Replace it by including 'net/udp.h'. Do the same for tcp_v4_early_demux().

Signed-off-by: Wang Liang <wangliang74@huawei.com>
Link: https://patch.msgid.link/20251025092637.1020960-1-wangliang74@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Wang Liang and committed by
Jakub Kicinski
f58abec2 a8abe8e2

+2 -2
+2 -2
net/ipv4/ip_input.c
··· 141 141 #include <linux/mroute.h> 142 142 #include <linux/netlink.h> 143 143 #include <net/dst_metadata.h> 144 + #include <net/udp.h> 145 + #include <net/tcp.h> 144 146 145 147 /* 146 148 * Process Router Attention IP option (RFC 2113) ··· 319 317 ip_hdr(hint)->tos == iph->tos; 320 318 } 321 319 322 - int tcp_v4_early_demux(struct sk_buff *skb); 323 - enum skb_drop_reason udp_v4_early_demux(struct sk_buff *skb); 324 320 static int ip_rcv_finish_core(struct net *net, 325 321 struct sk_buff *skb, struct net_device *dev, 326 322 const struct sk_buff *hint)