Skip to content

Commit 1eb4112

Browse files
authored
Merge pull request #18877 from opensourcerouting/build-config-h-20250523
build: the war on `config.h` is a war of attrition, 2 of ∞
2 parents 52a21e9 + 40b5660 commit 1eb4112

16 files changed

+45
-79
lines changed

configure.ac

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,6 @@ m4_define([FRR_INCLUDES],
12401240
#include <stdlib.h>
12411241
#include <stddef.h>
12421242
#include <sys/types.h>
1243-
/* sys/conf.h depends on param.h on FBSD at least */
12441243
#include <sys/param.h>
12451244
/* Required for MAXSIG */
12461245
#include <signal.h>
@@ -1251,23 +1250,8 @@ m4_define([FRR_INCLUDES],
12511250
#include <net/if.h>
12521251
])dnl
12531252

1254-
dnl Same applies for HAVE_NET_IF_VAR_H, which HAVE_NETINET6_ND6_H and
1255-
dnl HAVE_NETINET_IN_VAR_H depend upon. But if_var.h depends on if.h, hence
1256-
dnl an additional round for it.
1257-
1258-
AC_CHECK_HEADERS([net/if_var.h], [], [], [FRR_INCLUDES])
1259-
1260-
m4_define([FRR_INCLUDES],
1261-
FRR_INCLUDES
1262-
[#ifdef HAVE_NET_IF_VAR_H
1263-
# include <net/if_var.h>
1264-
#endif
1265-
])dnl
1266-
12671253
AC_CHECK_HEADERS([netinet/in_var.h \
1268-
net/if_dl.h \
1269-
netinet/ip_icmp.h \
1270-
sys/sysctl.h sys/sockio.h sys/conf.h],
1254+
netinet/ip_icmp.h],
12711255
[], [], [FRR_INCLUDES])
12721256

12731257
AC_CHECK_HEADERS([ucontext.h], [], [],
@@ -1297,7 +1281,7 @@ FRR_INCLUDES
12971281
#ifdef HAVE_NETINET_IN_VAR_H
12981282
# include <netinet/in_var.h>
12991283
#endif
1300-
#ifdef HAVE_NET_IF_DL_H
1284+
#ifndef __linux__
13011285
# include <net/if_dl.h>
13021286
#endif
13031287
#include <net/route.h>
@@ -1797,15 +1781,12 @@ dnl ------------------
17971781
dnl IPv6 header checks
17981782
dnl ------------------
17991783
AC_CHECK_HEADERS([ \
1800-
netinet6/in6_var.h netinet6/nd6.h], [], [],
1784+
netinet6/nd6.h], [], [],
18011785
FRR_INCLUDES)
18021786

18031787
m4_define([FRR_INCLUDES],dnl
18041788
FRR_INCLUDES
18051789
[#include <netinet/icmp6.h>
1806-
#ifdef HAVE_NETINET6_IN6_VAR_H
1807-
# include <netinet6/in6_var.h>
1808-
#endif
18091790
#ifdef HAVE_NETINET6_ND6_H
18101791
# include <netinet6/nd6.h>
18111792
#endif
@@ -2310,7 +2291,7 @@ AC_CHECK_TYPES([
23102291
struct sockaddr_dl,
23112292
struct vifctl, struct mfcctl, struct sioc_sg_req,
23122293
vifi_t, struct sioc_vif_req, struct igmpmsg,
2313-
struct ifaliasreq, struct in6_aliasreq,
2294+
struct ifaliasreq,
23142295
struct nd_opt_adv_interval,
23152296
struct nd_opt_homeagent_info, struct nd_opt_adv_interval,
23162297
struct nd_opt_rdnss, struct nd_opt_dnssl],

eigrpd/eigrp_packet.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212

1313
#include <zebra.h>
1414

15+
#ifndef __linux__
16+
#include <net/if_dl.h>
17+
#endif
18+
1519
#include "frrevent.h"
1620
#include "memory.h"
1721
#include "linklist.h"

ldpd/packet.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99

1010
#include <zebra.h>
1111

12+
#ifndef __linux__
13+
#include <net/if_dl.h>
14+
#endif
15+
1216
#include "ldpd.h"
1317
#include "ldpe.h"
1418
#include "log.h"

lib/prefix.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#ifndef _ZEBRA_PREFIX_H
88
#define _ZEBRA_PREFIX_H
99

10-
#ifdef GNU_LINUX
10+
#ifdef __linux__
1111
#include <net/ethernet.h>
1212
#else
1313
#include <netinet/if_ether.h>

lib/sockopt.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55

66
#include <zebra.h>
77

8+
#ifndef __linux__
9+
#include <net/if_dl.h>
10+
#endif
11+
812
#include "log.h"
913
#include "sockopt.h"
1014
#include "sockunion.h"

lib/sockunion.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55

66
#include <zebra.h>
77

8+
#ifndef __linux__
9+
#include <net/if_dl.h>
10+
#endif
11+
812
#include "prefix.h"
913
#include "vty.h"
1014
#include "sockunion.h"

lib/zebra.h

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,6 @@
1919
#include <ctype.h>
2020
#include <sys/types.h>
2121
#include <sys/param.h>
22-
#ifdef HAVE_SYS_SYSCTL_H
23-
#ifdef GNU_LINUX
24-
#include <linux/types.h>
25-
#else
26-
#include <sys/sysctl.h>
27-
#endif
28-
#endif /* HAVE_SYS_SYSCTL_H */
29-
#ifdef HAVE_SYS_CONF_H
30-
#include <sys/conf.h>
31-
#endif /* HAVE_SYS_CONF_H */
3222
#include <sys/time.h>
3323
#include <time.h>
3424
#include <inttypes.h>
@@ -44,10 +34,6 @@
4434

4535
#include <sys/socket.h>
4636

47-
#ifdef HAVE_SYS_SOCKIO_H
48-
#include <sys/sockio.h>
49-
#endif /* HAVE_SYS_SOCKIO_H */
50-
5137
#include "openbsd-tree.h"
5238

5339
#include <netinet/in.h>
@@ -56,14 +42,6 @@
5642

5743
#include <net/if.h>
5844

59-
#ifdef HAVE_NET_IF_DL_H
60-
#include <net/if_dl.h>
61-
#endif /* HAVE_NET_IF_DL_H */
62-
63-
#ifdef HAVE_NET_IF_VAR_H
64-
#include <net/if_var.h>
65-
#endif /* HAVE_NET_IF_VAR_H */
66-
6745
#ifndef HAVE_NETLINK
6846
#define RT_TABLE_MAIN 0
6947
#define RT_TABLE_LOCAL RT_TABLE_MAIN
@@ -76,10 +54,6 @@
7654
#include <netinet/in_var.h>
7755
#endif /* HAVE_NETINET_IN_VAR_H */
7856

79-
#ifdef HAVE_NETINET6_IN6_VAR_H
80-
#include <netinet6/in6_var.h>
81-
#endif /* HAVE_NETINET6_IN6_VAR_H */
82-
8357
#ifdef HAVE_NETINET6_IN_H
8458
#include <netinet6/in.h>
8559
#endif /* HAVE_NETINET6_IN_H */

ospf6d/ospf6_interface.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55

66
#include <zebra.h>
77

8+
#ifndef __linux__
9+
#include <net/if_dl.h>
10+
#endif
11+
812
#include "memory.h"
913
#include "if.h"
1014
#include "log.h"

ospfd/ospf_packet.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
#include <zebra.h>
88

9+
#ifndef __linux__
10+
#include <net/if_dl.h>
11+
#endif
12+
913
#include "monotime.h"
1014
#include "frrevent.h"
1115
#include "memory.h"

pceplib/pcep.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include "config.h"
1616
#endif
1717

18-
#if defined(linux) || defined(GNU_LINUX)
18+
#ifdef __linux__
1919

2020
#define ipv6_u __in6_u
2121
#else

zebra/if_sysctl.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
#if !defined(GNU_LINUX) && !defined(OPEN_BSD)
1212

13+
#include <sys/sysctl.h>
14+
1315
#include "if.h"
1416
#include "sockunion.h"
1517
#include "prefix.h"

zebra/interface.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
#ifndef _ZEBRA_INTERFACE_H
88
#define _ZEBRA_INTERFACE_H
99

10+
#ifndef __linux__
11+
#include <net/if_dl.h>
12+
#endif
13+
1014
#include "redistribute.h"
1115
#include "vrf.h"
1216
#include "hook.h"

zebra/ioctl.c

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
#include <zebra.h>
88

99
#include <sys/ioctl.h>
10+
#ifndef __linux__
11+
#include <netinet6/in6_var.h>
12+
#endif
1013

1114
#include "linklist.h"
1215
#include "if.h"
@@ -533,12 +536,6 @@ int if_unset_flags(struct interface *ifp, uint64_t flags)
533536
}
534537

535538
#ifndef LINUX_IPV6 /* Netlink has its own code */
536-
537-
#ifdef HAVE_STRUCT_IN6_ALIASREQ
538-
#ifndef ND6_INFINITE_LIFETIME
539-
#define ND6_INFINITE_LIFETIME 0xffffffffL
540-
#endif /* ND6_INFINITE_LIFETIME */
541-
542539
/*
543540
* Helper for interface-addr install, non-netlink
544541
*/
@@ -614,29 +611,9 @@ static int if_unset_prefix6_ctx(const struct zebra_dplane_ctx *ctx)
614611
#endif
615612
memcpy(&addreq.ifra_prefixmask, &mask, sizeof(struct sockaddr_in6));
616613

617-
#ifdef HAVE_STRUCT_IF6_ALIASREQ_IFRA_LIFETIME
618-
addreq.ifra_lifetime.ia6t_pltime = ND6_INFINITE_LIFETIME;
619-
addreq.ifra_lifetime.ia6t_vltime = ND6_INFINITE_LIFETIME;
620-
#endif
621-
622614
ret = if_ioctl_ipv6(SIOCDIFADDR_IN6, (caddr_t)&addreq);
623615
if (ret < 0)
624616
return ret;
625617
return 0;
626618
}
627-
#else
628-
/* The old, pre-dataplane code here just returned, so we're retaining that
629-
* choice.
630-
*/
631-
static int if_set_prefix6_ctx(const struct zebra_dplane_ctx *ctx)
632-
{
633-
return 0;
634-
}
635-
636-
static int if_unset_prefix6_ctx(const struct zebra_dplane_ctx *ctx)
637-
{
638-
return 0;
639-
}
640-
#endif /* HAVE_STRUCT_IN6_ALIASREQ */
641-
642619
#endif /* LINUX_IPV6 */

zebra/ipforward_sysctl.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#if !defined(GNU_LINUX)
99

10+
#include <sys/sysctl.h>
11+
1012
#include "privs.h"
1113
#include "zebra/ipforward.h"
1214
#include "zebra/zebra_errors.h"

zebra/rtread_sysctl.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
#if !defined(GNU_LINUX)
1212

13+
#include <sys/sysctl.h>
14+
1315
#include "memory.h"
1416
#include "log.h"
1517
#include "vrf.h"

zebra/table_manager.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ extern "C" {
2121
/* routing table identifiers
2222
*
2323
*/
24-
#if !defined(GNU_LINUX)
24+
#ifndef __linux__
2525
/* BSD systems
2626
*/
2727
#define RT_TABLE_ID_MAIN 0
@@ -33,7 +33,7 @@ extern "C" {
3333
#define RT_TABLE_ID_DEFAULT 253
3434
#define RT_TABLE_ID_COMPAT 252
3535
#define RT_TABLE_ID_UNSPEC 0
36-
#endif /* !def(GNU_LINUX) */
36+
#endif /* !__linux__ */
3737

3838
/*
3939
* Table chunk struct

0 commit comments

Comments
 (0)