diff options
author | Eric Dumazet <edumazet@google.com> | 2013-01-07 04:28:21 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-08 20:51:54 -0500 |
commit | fda55eca5a33f33ffcd4192c6b2d75179714a52c (patch) | |
tree | 54b8e755273ab37fa54cfdd0867b2e7631eb4b10 /include | |
parent | 0edb7ede7d524377afbaf48a35654baa52368f4b (diff) |
net: introduce skb_transport_header_was_set()
We have skb_mac_header_was_set() helper to tell if mac_header
was set on a skb. We would like the same for transport_header.
__netif_receive_skb() doesn't reset the transport header if already
set by GRO layer.
Note that network stacks usually reset the transport header anyway,
after pulling the network header, so this change only allows
a followup patch to have more precise qdisc pkt_len computation
for GSO packets at ingress side.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/skbuff.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 320e976d5ab8..8b2256e880e0 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -1492,6 +1492,11 @@ static inline void skb_set_inner_network_header(struct sk_buff *skb, | |||
1492 | skb->inner_network_header += offset; | 1492 | skb->inner_network_header += offset; |
1493 | } | 1493 | } |
1494 | 1494 | ||
1495 | static inline bool skb_transport_header_was_set(const struct sk_buff *skb) | ||
1496 | { | ||
1497 | return skb->transport_header != ~0U; | ||
1498 | } | ||
1499 | |||
1495 | static inline unsigned char *skb_transport_header(const struct sk_buff *skb) | 1500 | static inline unsigned char *skb_transport_header(const struct sk_buff *skb) |
1496 | { | 1501 | { |
1497 | return skb->head + skb->transport_header; | 1502 | return skb->head + skb->transport_header; |
@@ -1580,6 +1585,11 @@ static inline void skb_set_inner_network_header(struct sk_buff *skb, | |||
1580 | skb->inner_network_header = skb->data + offset; | 1585 | skb->inner_network_header = skb->data + offset; |
1581 | } | 1586 | } |
1582 | 1587 | ||
1588 | static inline bool skb_transport_header_was_set(const struct sk_buff *skb) | ||
1589 | { | ||
1590 | return skb->transport_header != NULL; | ||
1591 | } | ||
1592 | |||
1583 | static inline unsigned char *skb_transport_header(const struct sk_buff *skb) | 1593 | static inline unsigned char *skb_transport_header(const struct sk_buff *skb) |
1584 | { | 1594 | { |
1585 | return skb->transport_header; | 1595 | return skb->transport_header; |