mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 14:11:20 +00:00
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:
parent
6da025fa23
commit
94e187c015
11 changed files with 32 additions and 26 deletions
|
@ -213,6 +213,15 @@ static inline void rt6_set_from(struct rt6_info *rt, struct rt6_info *from)
|
|||
dst_hold(new);
|
||||
}
|
||||
|
||||
static inline void ip6_rt_put(struct rt6_info *rt)
|
||||
{
|
||||
/* dst_release() accepts a NULL parameter.
|
||||
* We rely on dst being first structure in struct rt6_info
|
||||
*/
|
||||
BUILD_BUG_ON(offsetof(struct rt6_info, dst) != 0);
|
||||
dst_release(&rt->dst);
|
||||
}
|
||||
|
||||
struct fib6_walker_t {
|
||||
struct list_head lh;
|
||||
struct fib6_node *root, *node;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue