Commit fa0583c2 authored by Yuya Tajima's avatar Yuya Tajima Committed by David S. Miller

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: default avatarYuya Tajima <yuya.tajimaa@gmail.com>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 81cf1ade
...@@ -458,8 +458,6 @@ static int ipv6_srh_rcv(struct sk_buff *skb) ...@@ -458,8 +458,6 @@ static int ipv6_srh_rcv(struct sk_buff *skb)
ipv6_hdr(skb)->daddr = *addr; ipv6_hdr(skb)->daddr = *addr;
skb_dst_drop(skb);
ip6_route_input(skb); ip6_route_input(skb);
if (skb_dst(skb)->error) { if (skb_dst(skb)->error) {
...@@ -834,7 +832,6 @@ static int ipv6_rthdr_rcv(struct sk_buff *skb) ...@@ -834,7 +832,6 @@ static int ipv6_rthdr_rcv(struct sk_buff *skb)
*addr = ipv6_hdr(skb)->daddr; *addr = ipv6_hdr(skb)->daddr;
ipv6_hdr(skb)->daddr = daddr; ipv6_hdr(skb)->daddr = daddr;
skb_dst_drop(skb);
ip6_route_input(skb); ip6_route_input(skb);
if (skb_dst(skb)->error) { if (skb_dst(skb)->error) {
skb_push(skb, skb->data - skb_network_header(skb)); skb_push(skb, skb->data - skb_network_header(skb));
......
...@@ -470,8 +470,6 @@ static int seg6_input_core(struct net *net, struct sock *sk, ...@@ -470,8 +470,6 @@ static int seg6_input_core(struct net *net, struct sock *sk,
dst = dst_cache_get(&slwt->cache); dst = dst_cache_get(&slwt->cache);
preempt_enable(); preempt_enable();
skb_dst_drop(skb);
if (!dst) { if (!dst) {
ip6_route_input(skb); ip6_route_input(skb);
dst = skb_dst(skb); dst = skb_dst(skb);
...@@ -482,6 +480,7 @@ static int seg6_input_core(struct net *net, struct sock *sk, ...@@ -482,6 +480,7 @@ static int seg6_input_core(struct net *net, struct sock *sk,
preempt_enable(); preempt_enable();
} }
} else { } else {
skb_dst_drop(skb);
skb_dst_set(skb, dst); skb_dst_set(skb, dst);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment