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>
This commit is contained in:
parent
429a22ca39
commit
fbbdb8f096
|
@ -1560,19 +1560,6 @@ static inline void skb_set_transport_header(struct sk_buff *skb,
|
||||||
skb->transport_header += offset;
|
skb->transport_header += offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void skb_probe_transport_header(struct sk_buff *skb,
|
|
||||||
const int offset_hint)
|
|
||||||
{
|
|
||||||
struct flow_keys keys;
|
|
||||||
|
|
||||||
if (skb_transport_header_was_set(skb))
|
|
||||||
return;
|
|
||||||
else if (skb_flow_dissect(skb, &keys))
|
|
||||||
skb_set_transport_header(skb, keys.thoff);
|
|
||||||
else
|
|
||||||
skb_set_transport_header(skb, offset_hint);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline unsigned char *skb_network_header(const struct sk_buff *skb)
|
static inline unsigned char *skb_network_header(const struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
return skb->head + skb->network_header;
|
return skb->head + skb->network_header;
|
||||||
|
@ -1716,6 +1703,19 @@ static inline void skb_set_mac_header(struct sk_buff *skb, const int offset)
|
||||||
}
|
}
|
||||||
#endif /* NET_SKBUFF_DATA_USES_OFFSET */
|
#endif /* NET_SKBUFF_DATA_USES_OFFSET */
|
||||||
|
|
||||||
|
static inline void skb_probe_transport_header(struct sk_buff *skb,
|
||||||
|
const int offset_hint)
|
||||||
|
{
|
||||||
|
struct flow_keys keys;
|
||||||
|
|
||||||
|
if (skb_transport_header_was_set(skb))
|
||||||
|
return;
|
||||||
|
else if (skb_flow_dissect(skb, &keys))
|
||||||
|
skb_set_transport_header(skb, keys.thoff);
|
||||||
|
else
|
||||||
|
skb_set_transport_header(skb, offset_hint);
|
||||||
|
}
|
||||||
|
|
||||||
static inline void skb_mac_header_rebuild(struct sk_buff *skb)
|
static inline void skb_mac_header_rebuild(struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
if (skb_mac_header_was_set(skb)) {
|
if (skb_mac_header_was_set(skb)) {
|
||||||
|
|
Loading…
Reference in New Issue