ipv6: remove unnecessary dst_hold() in ip6_fragment()
In ipv6 tx path, rcu_read_lock() is taken so that dst won't get freed during the execution of ip6_fragment(). Hence, no need to hold dst in it. Signed-off-by: Wei Wang <weiwan@google.com> Acked-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
273889e306
commit
1758fd4688
1 changed files with 0 additions and 4 deletions
|
@ -698,8 +698,6 @@ int ip6_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,
|
||||||
ipv6_hdr(skb)->payload_len = htons(first_len -
|
ipv6_hdr(skb)->payload_len = htons(first_len -
|
||||||
sizeof(struct ipv6hdr));
|
sizeof(struct ipv6hdr));
|
||||||
|
|
||||||
dst_hold(&rt->dst);
|
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
/* Prepare header of the next frame,
|
/* Prepare header of the next frame,
|
||||||
* before previous one went down. */
|
* before previous one went down. */
|
||||||
|
@ -742,7 +740,6 @@ int ip6_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,
|
||||||
if (err == 0) {
|
if (err == 0) {
|
||||||
IP6_INC_STATS(net, ip6_dst_idev(&rt->dst),
|
IP6_INC_STATS(net, ip6_dst_idev(&rt->dst),
|
||||||
IPSTATS_MIB_FRAGOKS);
|
IPSTATS_MIB_FRAGOKS);
|
||||||
ip6_rt_put(rt);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -750,7 +747,6 @@ int ip6_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,
|
||||||
|
|
||||||
IP6_INC_STATS(net, ip6_dst_idev(&rt->dst),
|
IP6_INC_STATS(net, ip6_dst_idev(&rt->dst),
|
||||||
IPSTATS_MIB_FRAGFAILS);
|
IPSTATS_MIB_FRAGFAILS);
|
||||||
ip6_rt_put(rt);
|
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
slow_path_clean:
|
slow_path_clean:
|
||||||
|
|
Loading…
Add table
Reference in a new issue