Commit c5ec13e3 authored by Kuniyuki Iwashima's avatar Kuniyuki Iwashima Committed by Jakub Kicinski

ipv6: rpl: Remove redundant skb_dst_drop().

RPL code has a pattern where skb_dst_drop() is called before
ip6_route_input().

However, ip6_route_input() calls skb_dst_drop() internally,
so we need not call skb_dst_drop() before ip6_route_input().
Signed-off-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20230710213511.5364-1-kuniyu@amazon.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent fa3530be
...@@ -612,8 +612,6 @@ static int ipv6_rpl_srh_rcv(struct sk_buff *skb) ...@@ -612,8 +612,6 @@ static int ipv6_rpl_srh_rcv(struct sk_buff *skb)
kfree(buf); kfree(buf);
skb_dst_drop(skb);
ip6_route_input(skb); ip6_route_input(skb);
if (skb_dst(skb)->error) { if (skb_dst(skb)->error) {
......
...@@ -272,8 +272,6 @@ static int rpl_input(struct sk_buff *skb) ...@@ -272,8 +272,6 @@ static int rpl_input(struct sk_buff *skb)
dst = dst_cache_get(&rlwt->cache); dst = dst_cache_get(&rlwt->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);
...@@ -284,6 +282,7 @@ static int rpl_input(struct sk_buff *skb) ...@@ -284,6 +282,7 @@ static int rpl_input(struct sk_buff *skb)
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