All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guillaume Nault <gnault@redhat.com>
To: Ido Schimmel <idosch@nvidia.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
	pabeni@redhat.com, edumazet@google.com, dsahern@kernel.org
Subject: Re: [PATCH net-next] ipv4: Fix user space build failure due to header change
Date: Tue, 3 Sep 2024 17:30:48 +0200	[thread overview]
Message-ID: <ZtcrqPPEiX/L+2i6@debian> (raw)
In-Reply-To: <20240903133554.2807343-1-idosch@nvidia.com>

On Tue, Sep 03, 2024 at 04:35:54PM +0300, Ido Schimmel wrote:
> RT_TOS() from include/uapi/linux/in_route.h is defined using
> IPTOS_TOS_MASK from include/uapi/linux/ip.h. This is problematic for
> files such as include/net/ip_fib.h that want to use RT_TOS() as without
> including both header files kernel compilation fails:
> 
> In file included from ./include/net/ip_fib.h:25,
>                  from ./include/net/route.h:27,
>                  from ./include/net/lwtunnel.h:9,
>                  from net/core/dst.c:24:
> ./include/net/ip_fib.h: In function ‘fib_dscp_masked_match’:
> ./include/uapi/linux/in_route.h:31:32: error: ‘IPTOS_TOS_MASK’ undeclared (first use in this function)
>    31 | #define RT_TOS(tos)     ((tos)&IPTOS_TOS_MASK)
>       |                                ^~~~~~~~~~~~~~
> ./include/net/ip_fib.h:440:45: note: in expansion of macro ‘RT_TOS’
>   440 |         return dscp == inet_dsfield_to_dscp(RT_TOS(fl4->flowi4_tos));
> 
> Therefore, cited commit changed linux/in_route.h to include linux/ip.h.
> However, as reported by David, this breaks iproute2 compilation due
> overlapping definitions between linux/ip.h and
> /usr/include/netinet/ip.h:
> 
> In file included from ../include/uapi/linux/in_route.h:5,
>                  from iproute.c:19:
> ../include/uapi/linux/ip.h:25:9: warning: "IPTOS_TOS" redefined
>    25 | #define IPTOS_TOS(tos)          ((tos)&IPTOS_TOS_MASK)
>       |         ^~~~~~~~~
> In file included from iproute.c:17:
> /usr/include/netinet/ip.h:222:9: note: this is the location of the previous definition
>   222 | #define IPTOS_TOS(tos)          ((tos) & IPTOS_TOS_MASK)
> 
> Fix by changing include/net/ip_fib.h to include linux/ip.h. Note that
> usage of RT_TOS() should not spread further in the kernel due to recent
> work in this area.

Reviewed-by: Guillaume Nault <gnault@redhat.com>


  parent reply	other threads:[~2024-09-03 15:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-03 13:35 [PATCH net-next] ipv4: Fix user space build failure due to header change Ido Schimmel
2024-09-03 14:39 ` David Ahern
2024-09-03 15:30 ` Guillaume Nault [this message]
2024-09-05  0:00 ` patchwork-bot+netdevbpf

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=ZtcrqPPEiX/L+2i6@debian \
    --to=gnault@redhat.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.