Skip to content

Commit

Permalink
dst: Add __skb_dst_copy() variation
Browse files Browse the repository at this point in the history
This variation on skb_dst_copy() doesn't require two skbs.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Joe Stringer authored and David S. Miller committed Aug 27, 2015
1 parent 5b49004 commit e79e259
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions include/net/dst.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,18 @@ static inline void skb_dst_drop(struct sk_buff *skb)
}
}

static inline void skb_dst_copy(struct sk_buff *nskb, const struct sk_buff *oskb)
static inline void __skb_dst_copy(struct sk_buff *nskb, unsigned long refdst)
{
nskb->_skb_refdst = oskb->_skb_refdst;
nskb->_skb_refdst = refdst;
if (!(nskb->_skb_refdst & SKB_DST_NOREF))
dst_clone(skb_dst(nskb));
}

static inline void skb_dst_copy(struct sk_buff *nskb, const struct sk_buff *oskb)
{
__skb_dst_copy(nskb, oskb->_skb_refdst);
}

/**
* skb_dst_force - makes sure skb dst is refcounted
* @skb: buffer
Expand Down

0 comments on commit e79e259

Please sign in to comment.