summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Stringer <joestringer@nicira.com>2015-08-26 18:31:47 (GMT)
committerDavid S. Miller <davem@davemloft.net>2015-08-27 18:40:42 (GMT)
commite79e259588a414589a016edc428ee8dd308f81ad (patch)
tree868bbb4dc60685db9091172031aa14b9d02599f8
parent5b490047240f7b986228de968334ddd7a341e1fe (diff)
downloadlinux-e79e259588a414589a016edc428ee8dd308f81ad.tar.xz
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>
-rw-r--r--include/net/dst.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/net/dst.h b/include/net/dst.h
index ef8f1d4..4c48016 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -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