Thread (23 messages) 23 messages, 3 authors, 2015-08-25

[PATCHv5 net-next 04/10] dst: Add __skb_dst_copy() variation

flat view
STALE4084d SUPERSEDED: 1 (0M)

From: Joe Stringer <hidden>
Date: 2015-08-25 00:35:06
Also in: lkml, netfilter-devel
Subsystem: networking [general], the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Status: Superseded by v6 (posted 2015-08-26). [go to v6]

Revision v5 (7 revisions archived); 1 review trailer.

Revisions (7)
  1. rfc
  2. v2 [diff against previous] re-posted go to this post
  3. v1 [diff against previous]
  4. v3 [diff against previous]
  5. v4 [diff against previous]
  6. v5 current [diff against previous]
  7. v6 [diff against previous]
This variation on skb_dst_copy() doesn't require two skbs.

Signed-off-by: Joe Stringer <redacted>
Acked-by: Pravin B Shelar <redacted>
---
v4: Add ack.
v5: No change.
---
 include/net/dst.h | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/include/net/dst.h b/include/net/dst.h
index 0a9a723..6f282e7 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -286,13 +286,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
-- 
2.1.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help