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

ipv4: remove useless arg

The "struct sock *sk" parameter in ip_rcv_finish_core is unused, which
leads the compiler to optimize it out. As a result, the
"struct sk_buff *skb" parameter is passed using x1. And this make kprobe
hard to use.

Signed-off-by: Yu Tian <tianyu2@kernelsoft.com>
Link: https://patch.msgid.link/20241231023610.1657926-1-tianyu2@kernelsoft.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Yu Tian and committed by
Jakub Kicinski
5df7ca0b bb70b0d4

+5 -6
+5 -6
net/ipv4/ip_input.c
··· 314 314 315 315 int tcp_v4_early_demux(struct sk_buff *skb); 316 316 int udp_v4_early_demux(struct sk_buff *skb); 317 - static int ip_rcv_finish_core(struct net *net, struct sock *sk, 317 + static int ip_rcv_finish_core(struct net *net, 318 318 struct sk_buff *skb, struct net_device *dev, 319 319 const struct sk_buff *hint) 320 320 { ··· 442 442 if (!skb) 443 443 return NET_RX_SUCCESS; 444 444 445 - ret = ip_rcv_finish_core(net, sk, skb, dev, NULL); 445 + ret = ip_rcv_finish_core(net, skb, dev, NULL); 446 446 if (ret != NET_RX_DROP) 447 447 ret = dst_input(skb); 448 448 return ret; ··· 589 589 return skb; 590 590 } 591 591 592 - static void ip_list_rcv_finish(struct net *net, struct sock *sk, 593 - struct list_head *head) 592 + static void ip_list_rcv_finish(struct net *net, struct list_head *head) 594 593 { 595 594 struct sk_buff *skb, *next, *hint = NULL; 596 595 struct dst_entry *curr_dst = NULL; ··· 606 607 skb = l3mdev_ip_rcv(skb); 607 608 if (!skb) 608 609 continue; 609 - if (ip_rcv_finish_core(net, sk, skb, dev, hint) == NET_RX_DROP) 610 + if (ip_rcv_finish_core(net, skb, dev, hint) == NET_RX_DROP) 610 611 continue; 611 612 612 613 dst = skb_dst(skb); ··· 632 633 { 633 634 NF_HOOK_LIST(NFPROTO_IPV4, NF_INET_PRE_ROUTING, net, NULL, 634 635 head, dev, NULL, ip_rcv_finish); 635 - ip_list_rcv_finish(net, NULL, head); 636 + ip_list_rcv_finish(net, head); 636 637 } 637 638 638 639 /* Receive a list of IP packets */