Skip to content

Commit e79e259

Browse files
joestringerdavem330
authored andcommitted
dst: Add __skb_dst_copy() variation
This variation on skb_dst_copy() doesn't require two skbs. Signed-off-by: Joe Stringer <[email protected]> Acked-by: Pravin B Shelar <[email protected]> Acked-by: Thomas Graf <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5b49004 commit e79e259

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

include/net/dst.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,13 +289,18 @@ static inline void skb_dst_drop(struct sk_buff *skb)
289289
}
290290
}
291291

292-
static inline void skb_dst_copy(struct sk_buff *nskb, const struct sk_buff *oskb)
292+
static inline void __skb_dst_copy(struct sk_buff *nskb, unsigned long refdst)
293293
{
294-
nskb->_skb_refdst = oskb->_skb_refdst;
294+
nskb->_skb_refdst = refdst;
295295
if (!(nskb->_skb_refdst & SKB_DST_NOREF))
296296
dst_clone(skb_dst(nskb));
297297
}
298298

299+
static inline void skb_dst_copy(struct sk_buff *nskb, const struct sk_buff *oskb)
300+
{
301+
__skb_dst_copy(nskb, oskb->_skb_refdst);
302+
}
303+
299304
/**
300305
* skb_dst_force - makes sure skb dst is refcounted
301306
* @skb: buffer

0 commit comments

Comments
 (0)