]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
dst: Add __skb_dst_copy() variation
authorJoe Stringer <joestringer@nicira.com>
Wed, 26 Aug 2015 18:31:47 +0000 (11:31 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 27 Aug 2015 18:40:42 +0000 (11:40 -0700)
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>
include/net/dst.h

index ef8f1d43a2033bc67ab3c8f3b08657191463654e..4c4801645371d12c5fadc5427c8a029c0ba1f1e3 100644 (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