Files
linux/include/uapi/linux
Ido Schimmel 1083d733eb ipv4: Fix user space build failure due to header change
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.

Fixes: 1fa3314c14 ("ipv4: Centralize TOS matching")
Reported-by: David Ahern <dsahern@kernel.org>
Closes: https://lore.kernel.org/netdev/2f5146ff-507d-4cab-a195-b28c0c9e654e@kernel.org/
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Link: https://patch.msgid.link/20240903133554.2807343-1-idosch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-09-04 16:40:33 -07:00
..
2024-04-15 13:42:38 +02:00
2021-01-25 18:44:44 +01:00
2023-05-30 15:20:08 +01:00
2021-11-01 13:36:08 +00:00
2022-08-11 10:31:19 -07:00
2022-06-07 10:20:42 -07:00
2021-11-26 16:48:59 +01:00
2023-01-20 09:33:22 +00:00
2024-04-08 14:10:45 +01:00
2024-06-11 12:57:49 -05:00
2024-03-07 17:14:53 +00:00
2024-05-10 08:26:31 +02:00
2023-03-16 21:20:32 -07:00
2023-09-21 19:22:05 +02:00
2022-08-10 13:49:50 +01:00
2021-02-08 13:01:24 +01:00
2024-05-07 01:35:57 +02:00
2021-11-15 07:53:10 -08:00
2021-06-03 15:31:34 -07:00
2024-05-07 01:35:57 +02:00
2024-04-01 10:49:28 +01:00
2024-08-26 09:37:23 -07:00
2024-08-26 09:37:23 -07:00
2024-06-01 07:28:21 +02:00
2022-09-20 09:13:38 +02:00
2024-02-15 23:43:47 -05:00
2021-03-10 09:34:06 +01:00
2023-12-15 17:01:30 +01:00
2023-04-27 19:15:11 -06:00
2024-05-30 12:15:56 +02:00
2022-09-07 16:46:03 +02:00
2024-08-12 17:50:34 -07:00
2024-08-12 22:03:26 +02:00
2023-11-28 19:05:16 +00:00
2024-05-16 18:14:09 -05:00
2023-12-20 19:26:31 -05:00
2022-11-17 11:04:23 -08:00
2021-01-07 16:17:32 +01:00
2022-09-27 17:29:09 -07:00
2023-06-05 09:36:35 +02:00
2024-02-28 18:47:08 -07:00
2023-12-29 11:58:24 -08:00
2023-03-23 17:25:46 +01:00
2024-04-22 17:07:13 -04:00
2021-06-12 13:16:45 -07:00