netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Hangbin Liu <liuhangbin@gmail.com>
Cc: netdev@vger.kernel.org, Jay Vosburgh <j.vosburgh@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jonathan Toppins <jtoppins@redhat.com>,
	Paolo Abeni <pabeni@redhat.com>, David Ahern <dsahern@gmail.com>,
	Tom Herbert <tom@herbertland.com>,
	kernel test robot <lkp@intel.com>
Subject: Re: [PATCHv2 net] net: use struct_group to copy addresses
Date: Mon, 14 Nov 2022 21:16:45 -0800	[thread overview]
Message-ID: <20221114211645.539397df@kernel.org> (raw)
In-Reply-To: <20221114081210.1033795-1-liuhangbin@gmail.com>

On Mon, 14 Nov 2022 16:12:10 +0800 Hangbin Liu wrote:
> diff --git a/include/uapi/linux/ip.h b/include/uapi/linux/ip.h
> index 961ec16a26b8..6f7e833a00f7 100644
> --- a/include/uapi/linux/ip.h
> +++ b/include/uapi/linux/ip.h
> @@ -100,8 +100,10 @@ struct iphdr {
>  	__u8	ttl;
>  	__u8	protocol;
>  	__sum16	check;
> -	__be32	saddr;
> -	__be32	daddr;
> +	struct_group(addrs,
> +		__be32	saddr;
> +		__be32	daddr;
> +	);
>  	/*The options start here. */
>  };
>  
> diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h
> index 03cdbe798fe3..3a3a80496c7c 100644
> --- a/include/uapi/linux/ipv6.h
> +++ b/include/uapi/linux/ipv6.h
> @@ -130,8 +130,10 @@ struct ipv6hdr {
>  	__u8			nexthdr;
>  	__u8			hop_limit;
>  
> -	struct	in6_addr	saddr;
> -	struct	in6_addr	daddr;
> +	struct_group(addrs,
> +		struct	in6_addr	saddr;
> +		struct	in6_addr	daddr;
> +	);
>  };
>  

Can you double check the build with clang? It seems to fail with an odd
message, maybe some includes missing?

In file included from ./usr/include/linux/if_tunnel.h:7:
usr/include/linux/ip.h:103:2: error: type name requires a specifier or qualifier
        struct_group(addrs,
        ^
usr/include/linux/ip.h:104:3: error: unexpected type name '__be32': expected identifier
                __be32  saddr;
                ^
usr/include/linux/ip.h:104:10: error: expected ')'
                __be32  saddr;
                        ^
usr/include/linux/ip.h:103:14: note: to match this '('
        struct_group(addrs,
                    ^
usr/include/linux/ip.h:103:15: error: a parameter list without types is only allowed in a function definition
        struct_group(addrs,
                     ^
usr/include/linux/ip.h:106:2: error: type name requires a specifier or qualifier
        );
        ^
usr/include/linux/ip.h:106:2: error: expected member name or ';' after declaration specifiers
usr/include/linux/ip.h:105:16: error: expected ';' at end of declaration list
                __be32  daddr;
                              ^
                              ;

  reply	other threads:[~2022-11-15  5:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-14  8:12 [PATCHv2 net] net: use struct_group to copy addresses Hangbin Liu
2022-11-15  5:16 ` Jakub Kicinski [this message]
2022-11-15 13:32   ` Hangbin Liu

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=20221114211645.539397df@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=j.vosburgh@gmail.com \
    --cc=jtoppins@redhat.com \
    --cc=liuhangbin@gmail.com \
    --cc=lkp@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=tom@herbertland.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).