From: Yuya Tajima Date: Mon, 15 May 2023 15:34:27 +0000 (+0000) Subject: seg6: Cleanup duplicates of skb_dst_drop calls X-Git-Tag: v6.6.7~2536^2~265 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fa0583c202433c3d359a1b0579f52da16e25e4df;p=platform%2Fkernel%2Flinux-starfive.git seg6: Cleanup duplicates of skb_dst_drop calls In processing IPv6 segment routing header (SRH), several functions call skb_dst_drop before ip6_route_input. However, ip6_route_input calls skb_dst_drop within it, so there is no need to call skb_dst_drop in advance. Signed-off-by: Yuya Tajima Reviewed-by: Simon Horman Signed-off-by: David S. Miller --- diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c index a8d961d..04c14fc 100644 --- a/net/ipv6/exthdrs.c +++ b/net/ipv6/exthdrs.c @@ -458,8 +458,6 @@ looped_back: ipv6_hdr(skb)->daddr = *addr; - skb_dst_drop(skb); - ip6_route_input(skb); if (skb_dst(skb)->error) { @@ -834,7 +832,6 @@ looped_back: *addr = ipv6_hdr(skb)->daddr; ipv6_hdr(skb)->daddr = daddr; - skb_dst_drop(skb); ip6_route_input(skb); if (skb_dst(skb)->error) { skb_push(skb, skb->data - skb_network_header(skb)); diff --git a/net/ipv6/seg6_iptunnel.c b/net/ipv6/seg6_iptunnel.c index 34db881..03b877f 100644 --- a/net/ipv6/seg6_iptunnel.c +++ b/net/ipv6/seg6_iptunnel.c @@ -470,8 +470,6 @@ static int seg6_input_core(struct net *net, struct sock *sk, dst = dst_cache_get(&slwt->cache); preempt_enable(); - skb_dst_drop(skb); - if (!dst) { ip6_route_input(skb); dst = skb_dst(skb); @@ -482,6 +480,7 @@ static int seg6_input_core(struct net *net, struct sock *sk, preempt_enable(); } } else { + skb_dst_drop(skb); skb_dst_set(skb, dst); }