diff options
author | Ying Xue <ying.xue@windriver.com> | 2013-03-27 12:46:06 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-27 23:21:58 -0400 |
commit | fbbdb8f096e0e5d8244e1ffa46e364146ab9a440 (patch) | |
tree | 697ea6b58fa25f3481b7a6a31cccdfa0e9c422c8 | |
parent | 429a22ca39e531d9f8bacac1f81f7207909bcbd2 (diff) |
net: fix compile error of implicit declaration of skb_probe_transport_header
The commit 40893fd(net: switch to use skb_probe_transport_header())
involes a new error accidently. When NET_SKBUFF_DATA_USES_OFFSE is
not enabled, below compile error happens:
CC net/packet/af_packet.o
net/packet/af_packet.c: In function ‘packet_sendmsg_spkt’:
net/packet/af_packet.c:1516:2: error: implicit declaration of function ‘skb_probe_transport_header’ [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[2]: *** [net/packet/af_packet.o] Error 1
make[1]: *** [net/packet] Error 2
make: *** [net] Error 2
As it seems skb_probe_transport_header() is not related to
NET_SKBUFF_DATA_USES_OFFSE, we should move the definition of
skb_probe_transport_header() out of scope of
NET_SKBUFF_DATA_USES_OFFSE macro.
Cc: Jason Wang <jasowang@redhat.com>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/skbuff.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index fa88b966cb8e..878e0ee81068 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -1560,19 +1560,6 @@ static inline void skb_set_transport_header(struct sk_buff *skb, | |||
1560 | skb->transport_header += offset; | 1560 | skb->transport_header += offset; |
1561 | } | 1561 | } |
1562 | 1562 | ||
1563 | static inline void skb_probe_transport_header(struct sk_buff *skb, | ||
1564 | const int offset_hint) | ||
1565 | { | ||
1566 | struct flow_keys keys; | ||
1567 | |||
1568 | if (skb_transport_header_was_set(skb)) | ||
1569 | return; | ||
1570 | else if (skb_flow_dissect(skb, &keys)) | ||
1571 | skb_set_transport_header(skb, keys.thoff); | ||
1572 | else | ||
1573 | skb_set_transport_header(skb, offset_hint); | ||
1574 | } | ||
1575 | |||
1576 | static inline unsigned char *skb_network_header(const struct sk_buff *skb) | 1563 | static inline unsigned char *skb_network_header(const struct sk_buff *skb) |
1577 | { | 1564 | { |
1578 | return skb->head + skb->network_header; | 1565 | return skb->head + skb->network_header; |
@@ -1716,6 +1703,19 @@ static inline void skb_set_mac_header(struct sk_buff *skb, const int offset) | |||
1716 | } | 1703 | } |
1717 | #endif /* NET_SKBUFF_DATA_USES_OFFSET */ | 1704 | #endif /* NET_SKBUFF_DATA_USES_OFFSET */ |
1718 | 1705 | ||
1706 | static inline void skb_probe_transport_header(struct sk_buff *skb, | ||
1707 | const int offset_hint) | ||
1708 | { | ||
1709 | struct flow_keys keys; | ||
1710 | |||
1711 | if (skb_transport_header_was_set(skb)) | ||
1712 | return; | ||
1713 | else if (skb_flow_dissect(skb, &keys)) | ||
1714 | skb_set_transport_header(skb, keys.thoff); | ||
1715 | else | ||
1716 | skb_set_transport_header(skb, offset_hint); | ||
1717 | } | ||
1718 | |||
1719 | static inline void skb_mac_header_rebuild(struct sk_buff *skb) | 1719 | static inline void skb_mac_header_rebuild(struct sk_buff *skb) |
1720 | { | 1720 | { |
1721 | if (skb_mac_header_was_set(skb)) { | 1721 | if (skb_mac_header_was_set(skb)) { |