Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e79e2595 authored by Joe Stringer's avatar Joe Stringer Committed by David S. Miller
Browse files

dst: Add __skb_dst_copy() variation



This variation on skb_dst_copy() doesn't require two skbs.

Signed-off-by: default avatarJoe Stringer <joestringer@nicira.com>
Acked-by: default avatarPravin B Shelar <pshelar@nicira.com>
Acked-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5b490047
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -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