netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Ying Xue <ying.xue@windriver.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com
Subject: Re: [PATCH net-next] net: fix compile error of implicit declaration of skb_probe_transport_header
Date: Thu, 28 Mar 2013 11:12:06 +0800	[thread overview]
Message-ID: <5153B506.40105@redhat.com> (raw)
In-Reply-To: <1364438766-14042-1-git-send-email-ying.xue@windriver.com>

On 03/28/2013 10:46 AM, Ying Xue wrote:
> 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>
> ---
>  include/linux/skbuff.h |   26 +++++++++++++-------------
>  1 file changed, 13 insertions(+), 13 deletions(-)

Oops.

Acked-by: Jason Wang <jasowang@redhat.com>

Thanks
>
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index fa88b96..878e0ee 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,
>  	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)
>  {
>  	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 */
>  
> +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)
>  {
>  	if (skb_mac_header_was_set(skb)) {

  reply	other threads:[~2013-03-28  3:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-28  2:46 [PATCH net-next] net: fix compile error of implicit declaration of skb_probe_transport_header Ying Xue
2013-03-28  3:12 ` Jason Wang [this message]
2013-03-28  3:22   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5153B506.40105@redhat.com \
    --to=jasowang@redhat.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=ying.xue@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).