dst: Add __skb_dst_copy() variation

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>
This commit is contained in:
Joe Stringer 2015-08-26 11:31:47 -07:00 committed by David S. Miller
parent 5b49004724
commit e79e259588
1 changed files with 7 additions and 2 deletions

View File

@ -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