Skip to content

Commit

Permalink
sk_buff: introduce pskb_network_may_pull()
Browse files Browse the repository at this point in the history
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Changli Gao authored and David S. Miller committed Aug 5, 2010
1 parent 36d1269 commit f9599ce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -1379,6 +1379,11 @@ static inline int skb_network_offset(const struct sk_buff *skb)
return skb_network_header(skb) - skb->data;
}

static inline int pskb_network_may_pull(struct sk_buff *skb, unsigned int len)
{
return pskb_may_pull(skb, skb_network_offset(skb) + len);
}

/*
* CPUs often take a performance hit when accessing unaligned memory
* locations. The actual performance hit varies, it can be small if the
Expand Down

0 comments on commit f9599ce

Please sign in to comment.