net: skb->dst accessors
Define three accessors to get/set dst attached to a skb struct dst_entry *skb_dst(const struct sk_buff *skb) void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst) void skb_dst_drop(struct sk_buff *skb) This one should replace occurrences of : dst_release(skb->dst) skb->dst = NULL; Delete skb->dst field Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
511c3f92ad
commit
adf30907d6
@@ -48,7 +48,7 @@
|
||||
|
||||
inline int ip6_rcv_finish( struct sk_buff *skb)
|
||||
{
|
||||
if (skb->dst == NULL)
|
||||
if (skb_dst(skb) == NULL)
|
||||
ip6_route_input(skb);
|
||||
|
||||
return dst_input(skb);
|
||||
@@ -91,7 +91,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
|
||||
* arrived via the sending interface (ethX), because of the
|
||||
* nature of scoping architecture. --yoshfuji
|
||||
*/
|
||||
IP6CB(skb)->iif = skb->dst ? ip6_dst_idev(skb->dst)->dev->ifindex : dev->ifindex;
|
||||
IP6CB(skb)->iif = skb_dst(skb) ? ip6_dst_idev(skb_dst(skb))->dev->ifindex : dev->ifindex;
|
||||
|
||||
if (unlikely(!pskb_may_pull(skb, sizeof(*hdr))))
|
||||
goto err;
|
||||
@@ -161,7 +161,7 @@ static int ip6_input_finish(struct sk_buff *skb)
|
||||
int nexthdr, raw;
|
||||
u8 hash;
|
||||
struct inet6_dev *idev;
|
||||
struct net *net = dev_net(skb->dst->dev);
|
||||
struct net *net = dev_net(skb_dst(skb)->dev);
|
||||
|
||||
/*
|
||||
* Parse extension headers
|
||||
@@ -169,7 +169,7 @@ static int ip6_input_finish(struct sk_buff *skb)
|
||||
|
||||
rcu_read_lock();
|
||||
resubmit:
|
||||
idev = ip6_dst_idev(skb->dst);
|
||||
idev = ip6_dst_idev(skb_dst(skb));
|
||||
if (!pskb_pull(skb, skb_transport_offset(skb)))
|
||||
goto discard;
|
||||
nhoff = IP6CB(skb)->nhoff;
|
||||
@@ -242,8 +242,8 @@ int ip6_mc_input(struct sk_buff *skb)
|
||||
struct ipv6hdr *hdr;
|
||||
int deliver;
|
||||
|
||||
IP6_UPD_PO_STATS_BH(dev_net(skb->dst->dev),
|
||||
ip6_dst_idev(skb->dst), IPSTATS_MIB_INMCAST,
|
||||
IP6_UPD_PO_STATS_BH(dev_net(skb_dst(skb)->dev),
|
||||
ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_INMCAST,
|
||||
skb->len);
|
||||
|
||||
hdr = ipv6_hdr(skb);
|
||||
|
Reference in New Issue
Block a user