Skip to content

Commit 18adee0

Browse files
author
Hangbin Liu
committed
seg6: Cleanup duplicates of skb_dst_drop calls
JIRA: https://issues.redhat.com/browse/RHEL-30814 Upstream Status: net.git commit fa0583c commit fa0583c Author: Yuya Tajima <yuya.tajimaa@gmail.com> Date: Mon May 15 15:34:27 2023 +0000 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 <yuya.tajimaa@gmail.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Hangbin Liu <haliu@redhat.com>
1 parent b3dc398 commit 18adee0

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

net/ipv6/exthdrs.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,6 @@ static int ipv6_srh_rcv(struct sk_buff *skb)
447447

448448
ipv6_hdr(skb)->daddr = *addr;
449449

450-
skb_dst_drop(skb);
451-
452450
ip6_route_input(skb);
453451

454452
if (skb_dst(skb)->error) {
@@ -820,7 +818,6 @@ static int ipv6_rthdr_rcv(struct sk_buff *skb)
820818
*addr = ipv6_hdr(skb)->daddr;
821819
ipv6_hdr(skb)->daddr = daddr;
822820

823-
skb_dst_drop(skb);
824821
ip6_route_input(skb);
825822
if (skb_dst(skb)->error) {
826823
skb_push(skb, skb->data - skb_network_header(skb));

net/ipv6/seg6_iptunnel.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,6 @@ static int seg6_input_core(struct net *net, struct sock *sk,
470470
dst = dst_cache_get(&slwt->cache);
471471
preempt_enable();
472472

473-
skb_dst_drop(skb);
474-
475473
if (!dst) {
476474
ip6_route_input(skb);
477475
dst = skb_dst(skb);
@@ -482,6 +480,7 @@ static int seg6_input_core(struct net *net, struct sock *sk,
482480
preempt_enable();
483481
}
484482
} else {
483+
skb_dst_drop(skb);
485484
skb_dst_set(skb, dst);
486485
}
487486

0 commit comments

Comments
 (0)