ipv6: introduce ip6_rt_put()
As suggested by Eric, we could introduce a helper function for ipv6 too, to avoid checking if rt is NULL before dst_release(). Cc: Eric Dumazet <eric.dumazet@gmail.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Cong Wang <amwang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
6da025fa23
commit
94e187c015
@@ -663,8 +663,7 @@ ip6ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
|
||||
|
||||
icmpv6_send(skb2, rel_type, rel_code, rel_info);
|
||||
|
||||
if (rt)
|
||||
dst_release(&rt->dst);
|
||||
ip6_rt_put(rt);
|
||||
|
||||
kfree_skb(skb2);
|
||||
}
|
||||
@@ -1208,7 +1207,7 @@ static void ip6_tnl_link_config(struct ip6_tnl *t)
|
||||
if (dev->mtu < IPV6_MIN_MTU)
|
||||
dev->mtu = IPV6_MIN_MTU;
|
||||
}
|
||||
dst_release(&rt->dst);
|
||||
ip6_rt_put(rt);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user