diff options
author | Amerigo Wang <amwang@redhat.com> | 2012-10-29 00:13:19 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-11-03 14:59:05 -0400 |
commit | 94e187c01512c9cf29e2ff54bf1a1b045f38293d (patch) | |
tree | 2149f4652fb0fc997ce5728f9574e1ab5351f0e5 /net/ipv6/ndisc.c | |
parent | 6da025fa23bb10c82f80de319c837ed2b02306e4 (diff) | |
download | linux-3.10-94e187c01512c9cf29e2ff54bf1a1b045f38293d.tar.gz linux-3.10-94e187c01512c9cf29e2ff54bf1a1b045f38293d.tar.bz2 linux-3.10-94e187c01512c9cf29e2ff54bf1a1b045f38293d.zip |
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>
Diffstat (limited to 'net/ipv6/ndisc.c')
-rw-r--r-- | net/ipv6/ndisc.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index ff36194a71a..ae0cf818a8f 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c @@ -1145,7 +1145,7 @@ static void ndisc_router_discovery(struct sk_buff *skb) ND_PRINTK(0, err, "RA: %s got default router without neighbour\n", __func__); - dst_release(&rt->dst); + ip6_rt_put(rt); return; } } @@ -1170,7 +1170,7 @@ static void ndisc_router_discovery(struct sk_buff *skb) ND_PRINTK(0, err, "RA: %s got default router without neighbour\n", __func__); - dst_release(&rt->dst); + ip6_rt_put(rt); return; } neigh->flags |= NTF_ROUTER; @@ -1326,8 +1326,7 @@ skip_routeinfo: ND_PRINTK(2, warn, "RA: invalid RA options\n"); } out: - if (rt) - dst_release(&rt->dst); + ip6_rt_put(rt); if (neigh) neigh_release(neigh); } |