[PATCH net-next 2/7] net: ip: add drop reason to ip_route_input_rcu()

From: Menglong Dong
Date: Tue Oct 01 2024 - 02:01:32 EST


Add the pointer of the skb drop reason to the function arguments of
ip_route_input_rcu().

Signed-off-by: Menglong Dong <dongml2@xxxxxxxxxxxxxxx>
---
net/ipv4/route.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index f1767e0cc9d9..385efe6d71a7 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2415,7 +2415,8 @@ out: return err;

/* called with rcu_read_lock held */
static int ip_route_input_rcu(struct sk_buff *skb, __be32 daddr, __be32 saddr,
- u8 tos, struct net_device *dev, struct fib_result *res)
+ u8 tos, struct net_device *dev, struct fib_result *res,
+ enum skb_drop_reason *reason)
{
/* Multicast recognition logic is moved from route cache to here.
* The problem was that too many Ethernet cards have broken/missing
@@ -2473,7 +2474,7 @@ int ip_route_input_noref(struct sk_buff *skb, __be32 daddr, __be32 saddr,

tos &= INET_DSCP_MASK;
rcu_read_lock();
- err = ip_route_input_rcu(skb, daddr, saddr, tos, dev, &res);
+ err = ip_route_input_rcu(skb, daddr, saddr, tos, dev, &res, reason);
rcu_read_unlock();

return err;
@@ -3288,7 +3289,7 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh,
skb->mark = mark;
err = ip_route_input_rcu(skb, dst, src,
rtm->rtm_tos & INET_DSCP_MASK, dev,
- &res);
+ &res, NULL);

rt = skb_rtable(skb);
if (err == 0 && rt->dst.error)
--
2.39.5