net: add UAPI to the header guard in various network headers

fib_rule, ip6_tunnel, and a whole lot of if_* headers lack the customary
_UAPI in the header guard. Without it YNL build can't protect from in tree
and system headers both getting included. YNL doesn't need most of these
but it's annoying to have to fix them one by one.

Note that header installation strips this _UAPI prefix so this should
result in no change to the end user.

Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20250416200840.1338195-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Jakub Kicinski 2025-04-16 13:08:40 -07:00
parent 1df4a94544
commit 8066e388be
19 changed files with 46 additions and 46 deletions

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef __LINUX_FIB_RULES_H
#define __LINUX_FIB_RULES_H
#ifndef _UAPI__LINUX_FIB_RULES_H
#define _UAPI__LINUX_FIB_RULES_H
#include <linux/types.h>
#include <linux/rtnetlink.h>

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef __LINUX_IF_ADDR_H
#define __LINUX_IF_ADDR_H
#ifndef _UAPI__LINUX_IF_ADDR_H
#define _UAPI__LINUX_IF_ADDR_H
#include <linux/types.h>
#include <linux/netlink.h>

View File

@ -8,8 +8,8 @@
* YOSHIFUJI Hideaki @ USAGI/WIDE <yoshfuji@linux-ipv6.org>
*/
#ifndef __LINUX_IF_ADDRLABEL_H
#define __LINUX_IF_ADDRLABEL_H
#ifndef _UAPI__LINUX_IF_ADDRLABEL_H
#define _UAPI__LINUX_IF_ADDRLABEL_H
#include <linux/types.h>

View File

@ -11,8 +11,8 @@
*
*/
#ifndef _LINUX_IF_ALG_H
#define _LINUX_IF_ALG_H
#ifndef _UAPI_LINUX_IF_ALG_H
#define _UAPI_LINUX_IF_ALG_H
#include <linux/types.h>
@ -58,4 +58,4 @@ struct af_alg_iv {
#define ALG_OP_DECRYPT 0
#define ALG_OP_ENCRYPT 1
#endif /* _LINUX_IF_ALG_H */
#endif /* _UAPI_LINUX_IF_ALG_H */

View File

@ -14,8 +14,8 @@
* 2 of the License, or (at your option) any later version.
*/
#ifndef _LINUX_IF_ARCNET_H
#define _LINUX_IF_ARCNET_H
#ifndef _UAPI_LINUX_IF_ARCNET_H
#define _UAPI_LINUX_IF_ARCNET_H
#include <linux/types.h>
#include <linux/if_ether.h>
@ -127,4 +127,4 @@ struct archdr {
} soft;
};
#endif /* _LINUX_IF_ARCNET_H */
#endif /* _UAPI_LINUX_IF_ARCNET_H */

View File

@ -41,8 +41,8 @@
* - added definitions for various XOR hashing policies
*/
#ifndef _LINUX_IF_BONDING_H
#define _LINUX_IF_BONDING_H
#ifndef _UAPI_LINUX_IF_BONDING_H
#define _UAPI_LINUX_IF_BONDING_H
#include <linux/if.h>
#include <linux/types.h>
@ -152,4 +152,4 @@ enum {
};
#define BOND_3AD_STAT_MAX (__BOND_3AD_STAT_MAX - 1)
#endif /* _LINUX_IF_BONDING_H */
#endif /* _UAPI_LINUX_IF_BONDING_H */

View File

@ -18,8 +18,8 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#ifndef _LINUX_IF_FC_H
#define _LINUX_IF_FC_H
#ifndef _UAPI_LINUX_IF_FC_H
#define _UAPI_LINUX_IF_FC_H
#include <linux/types.h>
@ -49,4 +49,4 @@ struct fcllc {
__be16 ethertype; /* ether type field */
};
#endif /* _LINUX_IF_FC_H */
#endif /* _UAPI_LINUX_IF_FC_H */

View File

@ -20,8 +20,8 @@
* 2 of the License, or (at your option) any later version.
*/
#ifndef _LINUX_IF_HIPPI_H
#define _LINUX_IF_HIPPI_H
#ifndef _UAPI_LINUX_IF_HIPPI_H
#define _UAPI_LINUX_IF_HIPPI_H
#include <linux/types.h>
#include <asm/byteorder.h>
@ -151,4 +151,4 @@ struct hippi_hdr {
struct hippi_snap_hdr snap;
} __attribute__((packed));
#endif /* _LINUX_IF_HIPPI_H */
#endif /* _UAPI_LINUX_IF_HIPPI_H */

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef __LINUX_IF_PACKET_H
#define __LINUX_IF_PACKET_H
#ifndef _UAPI__LINUX_IF_PACKET_H
#define _UAPI__LINUX_IF_PACKET_H
#include <asm/byteorder.h>
#include <linux/types.h>

View File

@ -9,8 +9,8 @@
*
*/
#ifndef _LINUX_IF_PLIP_H
#define _LINUX_IF_PLIP_H
#ifndef _UAPI_LINUX_IF_PLIP_H
#define _UAPI_LINUX_IF_PLIP_H
#include <linux/sockios.h>

View File

@ -6,8 +6,8 @@
* KISS TNC driver.
*/
#ifndef __LINUX_SLIP_H
#define __LINUX_SLIP_H
#ifndef _UAPI__LINUX_SLIP_H
#define _UAPI__LINUX_SLIP_H
#define SL_MODE_SLIP 0
#define SL_MODE_CSLIP 1

View File

@ -13,8 +13,8 @@
* GNU General Public License for more details.
*/
#ifndef _IF_X25_H
#define _IF_X25_H
#ifndef _UAPI_IF_X25_H
#define _UAPI_IF_X25_H
#include <linux/types.h>
@ -24,4 +24,4 @@
#define X25_IFACE_DISCONNECT 0x02
#define X25_IFACE_PARAMS 0x03
#endif /* _IF_X25_H */
#endif /* _UAPI_IF_X25_H */

View File

@ -7,8 +7,8 @@
* Magnus Karlsson <magnus.karlsson@intel.com>
*/
#ifndef _LINUX_IF_XDP_H
#define _LINUX_IF_XDP_H
#ifndef _UAPI_LINUX_IF_XDP_H
#define _UAPI_LINUX_IF_XDP_H
#include <linux/types.h>
@ -180,4 +180,4 @@ struct xdp_desc {
/* TX packet carries valid metadata. */
#define XDP_TX_METADATA (1 << 1)
#endif /* _LINUX_IF_XDP_H */
#endif /* _UAPI_LINUX_IF_XDP_H */

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _IP6_TUNNEL_H
#define _IP6_TUNNEL_H
#ifndef _UAPI_IP6_TUNNEL_H
#define _UAPI_IP6_TUNNEL_H
#include <linux/types.h>
#include <linux/if.h> /* For IFNAMSIZ. */

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef __NET_DROPMON_H
#define __NET_DROPMON_H
#ifndef _UAPI__NET_DROPMON_H
#define _UAPI__NET_DROPMON_H
#include <linux/types.h>
#include <linux/netlink.h>

View File

@ -7,8 +7,8 @@
*
*/
#ifndef _NET_TIMESTAMPING_H
#define _NET_TIMESTAMPING_H
#ifndef _UAPI_NET_TIMESTAMPING_H
#define _UAPI_NET_TIMESTAMPING_H
#include <linux/types.h>
#include <linux/socket.h> /* for SO_TIMESTAMPING */
@ -216,4 +216,4 @@ struct sock_txtime {
__u32 flags; /* as defined by enum txtime_flags */
};
#endif /* _NET_TIMESTAMPING_H */
#endif /* _UAPI_NET_TIMESTAMPING_H */

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef __NETLINK_DIAG_H__
#define __NETLINK_DIAG_H__
#ifndef _UAPI__NETLINK_DIAG_H__
#define _UAPI__NETLINK_DIAG_H__
#include <linux/types.h>

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef __LINUX_PKT_CLS_H
#define __LINUX_PKT_CLS_H
#ifndef _UAPI__LINUX_PKT_CLS_H
#define _UAPI__LINUX_PKT_CLS_H
#include <linux/types.h>
#include <linux/pkt_sched.h>

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef __LINUX_PKT_SCHED_H
#define __LINUX_PKT_SCHED_H
#ifndef _UAPI__LINUX_PKT_SCHED_H
#define _UAPI__LINUX_PKT_SCHED_H
#include <linux/const.h>
#include <linux/types.h>