Skip to content

Commit 5df7ca0

Browse files
Yu Tiankuba-moo
authored andcommitted
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent bb70b0d commit 5df7ca0

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

net/ipv4/ip_input.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ static bool ip_can_use_hint(const struct sk_buff *skb, const struct iphdr *iph,
314314

315315
int tcp_v4_early_demux(struct sk_buff *skb);
316316
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,
318318
struct sk_buff *skb, struct net_device *dev,
319319
const struct sk_buff *hint)
320320
{
@@ -442,7 +442,7 @@ static int ip_rcv_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
442442
if (!skb)
443443
return NET_RX_SUCCESS;
444444

445-
ret = ip_rcv_finish_core(net, sk, skb, dev, NULL);
445+
ret = ip_rcv_finish_core(net, skb, dev, NULL);
446446
if (ret != NET_RX_DROP)
447447
ret = dst_input(skb);
448448
return ret;
@@ -589,8 +589,7 @@ static struct sk_buff *ip_extract_route_hint(const struct net *net,
589589
return skb;
590590
}
591591

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)
594593
{
595594
struct sk_buff *skb, *next, *hint = NULL;
596595
struct dst_entry *curr_dst = NULL;
@@ -607,7 +606,7 @@ static void ip_list_rcv_finish(struct net *net, struct sock *sk,
607606
skb = l3mdev_ip_rcv(skb);
608607
if (!skb)
609608
continue;
610-
if (ip_rcv_finish_core(net, sk, skb, dev, hint) == NET_RX_DROP)
609+
if (ip_rcv_finish_core(net, skb, dev, hint) == NET_RX_DROP)
611610
continue;
612611

613612
dst = skb_dst(skb);
@@ -633,7 +632,7 @@ static void ip_sublist_rcv(struct list_head *head, struct net_device *dev,
633632
{
634633
NF_HOOK_LIST(NFPROTO_IPV4, NF_INET_PRE_ROUTING, net, NULL,
635634
head, dev, NULL, ip_rcv_finish);
636-
ip_list_rcv_finish(net, NULL, head);
635+
ip_list_rcv_finish(net, head);
637636
}
638637

639638
/* Receive a list of IP packets */

0 commit comments

Comments
 (0)