Skip to content

Commit fa0583c

Browse files
Yuya9786davem330
authored andcommitted
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>
1 parent 81cf1ad commit fa0583c

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
@@ -458,8 +458,6 @@ static int ipv6_srh_rcv(struct sk_buff *skb)
458458

459459
ipv6_hdr(skb)->daddr = *addr;
460460

461-
skb_dst_drop(skb);
462-
463461
ip6_route_input(skb);
464462

465463
if (skb_dst(skb)->error) {
@@ -834,7 +832,6 @@ static int ipv6_rthdr_rcv(struct sk_buff *skb)
834832
*addr = ipv6_hdr(skb)->daddr;
835833
ipv6_hdr(skb)->daddr = daddr;
836834

837-
skb_dst_drop(skb);
838835
ip6_route_input(skb);
839836
if (skb_dst(skb)->error) {
840837
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)