Commit 563f0b8a authored by Francis Dupont's avatar Francis Dupont

Merged rt44535 (relay port)

parent 0d6d300f
......@@ -312,6 +312,19 @@ dhcp-users@lists.isc.org.
when building with --enable-use-sockets and --enable-ipv4-pktinfo.
[ISC-Bugs #36118]
(to be finalized before code freeze next year)
- Added experimental support for relay port (draft-ietf-dhc-relay-port-10.txt)
feature for DHCPv4, DHCPv6 and DHCPv4-over-DHCPv6. As the code points
were not yet assigned by IANA temporary (next free) values are used.
Relay port had be enabled at compile time via --enable-relay-port and
is fully backward compatible, i.e. works with previous implementations
of servers and relays, of course in this case using legacy ports.
A new --rp <relay-port> command line option specifies to dhcrelay
an alternate source port for upstream (i.e. toward the server) messages.
(update this)
Thanks to Naiming Shen and Enke Chen for submitting patches.
[ISC-Bugs #44535]
Changes since 4.3.6 (Bugs):
- Corrected an issue where the server would return a client's previously
......
......@@ -192,12 +192,51 @@ struct bpf_insn dhcp_bpf_filter [] = {
BPF_JUMP (BPF_JMP + BPF_JEQ + BPF_K, 67, 0, 1), /* patch */
/* If we passed all the tests, ask for the whole packet. */
BPF_STMT(BPF_RET+BPF_K, (u_int)-1),
BPF_STMT (BPF_RET + BPF_K, (u_int)-1),
/* Otherwise, drop it. */
BPF_STMT(BPF_RET+BPF_K, 0),
BPF_STMT (BPF_RET + BPF_K, 0),
};
#if defined(RELAY_PORT)
/*
* For relay port extension
*/
struct bpf_insn dhcp_bpf_relay_filter [] = {
/* Make sure this is an IP packet... */
BPF_STMT (BPF_LD + BPF_H + BPF_ABS, 12),
BPF_JUMP (BPF_JMP + BPF_JEQ + BPF_K, ETHERTYPE_IP, 0, 10),
/* Make sure it's a UDP packet... */
BPF_STMT (BPF_LD + BPF_B + BPF_ABS, 23),
BPF_JUMP (BPF_JMP + BPF_JEQ + BPF_K, IPPROTO_UDP, 0, 8),
/* Make sure this isn't a fragment... */
BPF_STMT(BPF_LD + BPF_H + BPF_ABS, 20),
BPF_JUMP(BPF_JMP + BPF_JSET + BPF_K, 0x1fff, 6, 0),
/* Get the IP header length... */
BPF_STMT (BPF_LDX + BPF_B + BPF_MSH, 14),
/* Make sure it's to the right port... */
BPF_STMT (BPF_LD + BPF_H + BPF_IND, 16),
BPF_JUMP (BPF_JMP + BPF_JEQ + BPF_K, 67, 2, 0), /* patch */
/* relay can have an alternative port... */
BPF_STMT (BPF_LD + BPF_H + BPF_IND, 16),
BPF_JUMP (BPF_JMP + BPF_JEQ + BPF_K, 67, 0, 1), /* patch */
/* If we passed all the tests, ask for the whole packet. */
BPF_STMT (BPF_RET + BPF_K, (u_int)-1),
/* Otherwise, drop it. */
BPF_STMT (BPF_RET + BPF_K, 0),
};
int dhcp_bpf_relay_filter_len =
sizeof dhcp_bpf_relay_filter / sizeof (struct bpf_insn);
#endif
#if defined (DEC_FDDI)
struct bpf_insn *bpf_fddi_filter = NULL;
#endif
......@@ -309,7 +348,19 @@ void if_register_receive (info)
/* Patch the server port into the BPF program...
XXX changes to filter program may require changes
to the insn number(s) used below! XXX */
dhcp_bpf_filter [8].k = ntohs (local_port);
#if defined(RELAY_PORT)
if (relay_port) {
/*
* If user defined relay UDP port, we need to filter
* also on the user UDP port.
*/
p.bf_len = dhcp_bpf_relay_filter_len;
p.bf_insns = dhcp_bpf_relay_filter;
dhcp_bpf_relay_filter [10].k = ntohs (relay_port);
}
#endif
p.bf_insns [8].k = ntohs (local_port);
if (ioctl (info -> rfdesc, BIOCSETF, &p) < 0)
log_fatal ("Can't install packet filter program: %m");
......
......@@ -44,6 +44,7 @@ int interfaces_invalidated;
int quiet_interface_discovery;
u_int16_t local_port;
u_int16_t remote_port;
u_int16_t relay_port = 0;
int dhcpv4_over_dhcpv6 = 0;
int (*dhcp_interface_setup_hook) (struct interface_info *, struct iaddr *);
int (*dhcp_interface_discovery_hook) (struct interface_info *);
......@@ -581,6 +582,10 @@ discover_interfaces(int state) {
int ir;
isc_result_t status;
int wifcount = 0;
#ifdef RELAY_PORT
int updone = 0;
int downdone = 0;
#endif
static int setup_fallback = 0;
......@@ -946,9 +951,39 @@ discover_interfaces(int state) {
switch (local_family) {
#ifdef DHCPv6
case AF_INET6:
#ifdef RELAY_PORT
#define UPSTREAM(ifp) \
((ifp->flags & INTERFACE_STREAMS) == INTERFACE_UPSTREAM)
#define DOWNSTREAM(ifp) \
((ifp->flags & INTERFACE_STREAMS) == INTERFACE_DOWNSTREAM)
if (relay_port) {
/*
* The normal IPv6 relay only needs one
* socket as long as we find an interface.
* When user relay port is defined, and we
* have two different UDP ports. One to
* receive from DHCP client with port 547,
* and the other is user defined for sending
* to the server or upstream relay agent.
* Thus we need to register sockets for one
* upstream and one downstream interfaces.
*/
if (updone && UPSTREAM(tmp))
continue;
if (downdone && DOWNSTREAM(tmp))
continue;
}
#endif
status = omapi_register_io_object((omapi_object_t *)tmp,
if_readsocket,
0, got_one_v6, 0, 0);
#ifdef RELAY_PORT
if (UPSTREAM(tmp))
updone++;
else
downdone++;
#endif
break;
#endif /* DHCPv6 */
case AF_INET:
......@@ -970,8 +1005,12 @@ discover_interfaces(int state) {
* dynamically adding and removing interfaces, but
* we're well beyond that point in terms of mess.
*/
if (((state == DISCOVER_SERVER) || (state == DISCOVER_RELAY)) &&
(local_family == AF_INET6))
if (((state == DISCOVER_SERVER) || (state == DISCOVER_RELAY))
&& (local_family == AF_INET6)
#if defined(RELAY_PORT)
&& ((relay_port == 0) || (updone && downdone))
#endif
)
break;
#endif
} /* for (tmp = interfaces; ... */
......
......@@ -409,6 +409,10 @@ void if_deregister_send (info)
XXX Changes to the filter program may require changes to the constant
offsets used in if_register_send to patch the NIT program! XXX */
#if defined(RELAY_PORT)
#error "Relay port is not yet supported for DLPI"
#endif
void if_register_receive (info)
struct interface_info *info;
{
......
......@@ -177,6 +177,11 @@ void if_deregister_send (info)
extern struct sock_filter dhcp_bpf_filter [];
extern int dhcp_bpf_filter_len;
#if defined(RELAY_PORT)
extern struct sock_filter dhcp_bpf_relay_filter [];
extern int dhcp_bpf_relay_filter_len;
#endif
#if defined (HAVE_TR_SUPPORT)
extern struct sock_filter dhcp_bpf_tr_filter [];
extern int dhcp_bpf_tr_filter_len;
......@@ -256,7 +261,19 @@ static void lpf_gen_filter_setup (info)
/* Patch the server port into the LPF program...
XXX changes to filter program may require changes
to the insn number(s) used below! XXX */
dhcp_bpf_filter [8].k = ntohs ((short)local_port);
#if defined(RELAY_PORT)
if (relay_port) {
/*
* If user defined relay UDP port, we need to filter
* also on the user UDP port.
*/
p.len = dhcp_bpf_relay_filter_len;
p.filter = dhcp_bpf_relay_filter;
dhcp_bpf_relay_filter [10].k = ntohs (relay_port);
}
#endif
dhcp_bpf_filter [8].k = ntohs (local_port);
if (setsockopt (info -> rfdesc, SOL_SOCKET, SO_ATTACH_FILTER, &p,
sizeof p) < 0) {
......
......@@ -172,6 +172,10 @@ void if_deregister_send (info)
XXX Changes to the filter program may require changes to the constant
offsets used in if_register_send to patch the NIT program! XXX */
#if defined(RELAY_PORT)
#error "Relay port is not yet supported for NIT"
#endif
void if_register_receive (info)
struct interface_info *info;
{
......
......@@ -167,6 +167,12 @@ void assemble_udp_ip_header (interface, buf, bufix,
/* Fill out the UDP header */
udp.uh_sport = local_port; /* XXX */
udp.uh_dport = port; /* XXX */
#if defined(RELAY_PORT)
/* Change to relay port defined if sending to server */
if (relay_port && (port == htons(67))) {
udp.uh_sport = relay_port;
}
#endif
udp.uh_ulen = htons(sizeof(udp) + len);
memset (&udp.uh_sum, 0, sizeof udp.uh_sum);
......@@ -296,7 +302,12 @@ decode_udp_ip_header(struct interface_info *interface,
return -1;
/* Is it to the port we're serving? */
#if defined(RELAY_PORT)
if ((udp.uh_dport != local_port) &&
((relay_port == 0) || (udp.uh_dport != relay_port)))
#else
if (udp.uh_dport != local_port)
#endif
return -1;
#endif /* USERLAND_FILTER */
......
......@@ -55,14 +55,14 @@ void if_register_send (info)
/* Set up the address we're going to connect to. */
name.sin_family = AF_INET;
name.sin_port = local_port;
name.sin_port = relay_port ? relay_port : local_port;
name.sin_addr.s_addr = htonl (INADDR_BROADCAST);
memset (name.sin_zero, 0, sizeof (name.sin_zero));
/* List addresses on which we're listening. */
if (!quiet_interface_discovery)
log_info ("Sending on %s, port %d",
piaddr (info -> address), htons (local_port));
piaddr (info -> address), htons (name.sin_port));
if ((sock = socket (AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0)
log_fatal ("Can't create dhcp socket: %m");
......
......@@ -65,6 +65,10 @@
static int no_global_v6_socket = 0;
static unsigned int global_v6_socket_references = 0;
static int global_v6_socket = -1;
#if defined(RELAY_PORT)
static unsigned int relay_port_v6_socket_references = 0;
static int relay_port_v6_socket = -1;
#endif
static void if_register_multicast(struct interface_info *info);
#endif
......@@ -157,6 +161,11 @@ if_register_socket(struct interface_info *info, int family,
addr6 = (struct sockaddr_in6 *)&name;
addr6->sin6_family = AF_INET6;
addr6->sin6_port = local_port;
#if defined(RELAY_PORT)
if (relay_port &&
((info->flags & INTERFACE_STREAMS) == INTERFACE_UPSTREAM))
addr6->sin6_port = relay_port;
#endif
/* A server feature */
if (bind_local_address6) {
memcpy(&addr6->sin6_addr,
......@@ -187,7 +196,7 @@ if_register_socket(struct interface_info *info, int family,
default:
addr = (struct sockaddr_in *)&name;
addr->sin_family = AF_INET;
addr->sin_port = local_port;
addr->sin_port = relay_port ? relay_port : local_port;
memcpy(&addr->sin_addr,
&local_address,
sizeof(addr->sin_addr));
......@@ -496,6 +505,10 @@ if_register6(struct interface_info *info, int do_multicast) {
log_fatal("Impossible condition at %s:%d", MDL);
}
#if defined(RELAY_PORT)
if (!relay_port ||
((info->flags & INTERFACE_STREAMS) == INTERFACE_DOWNSTREAM)) {
#endif
if (global_v6_socket_references == 0) {
global_v6_socket = if_register_socket(info, AF_INET6,
&req_multi, NULL);
......@@ -527,6 +540,30 @@ if_register6(struct interface_info *info, int do_multicast) {
info->wfdesc = global_v6_socket;
global_v6_socket_references++;
#if defined(RELAY_PORT)
} else {
/*
* If relay port is defined, we need to register one
* IPv6 UPD socket to handle upstream server or relay agent
* with a non-547 UDP local port.
*/
if ((relay_port_v6_socket_references == 0) &&
((info->flags & INTERFACE_STREAMS) == INTERFACE_UPSTREAM)) {
relay_port_v6_socket = if_register_socket(info, AF_INET6,
&req_multi, NULL);
if (relay_port_v6_socket < 0) {
log_fatal("Impossible condition at %s:%d", MDL);
} else {
log_info("Bound to relay port *:%d",
(int) ntohs(relay_port));
}
}
info->rfdesc = relay_port_v6_socket;
info->wfdesc = relay_port_v6_socket;
relay_port_v6_socket_references++;
}
#endif
if (req_multi)
if_register_multicast(info);
......@@ -617,6 +654,16 @@ if_deregister6(struct interface_info *info) {
global_v6_socket_references--;
info->rfdesc = -1;
info->wfdesc = -1;
#if defined(RELAY_PORT)
} else if (relay_port &&
(info->rfdesc == relay_port_v6_socket) &&
(info->wfdesc == relay_port_v6_socket) &&
(relay_port_v6_socket_references > 0)) {
/* Dereference the relay port v6 socket. */
relay_port_v6_socket_references--;
info->rfdesc = -1;
info->wfdesc = -1;
#endif
} else {
log_fatal("Impossible condition at %s:%d", MDL);
}
......@@ -633,12 +680,23 @@ if_deregister6(struct interface_info *info) {
}
}
if (!no_global_v6_socket &&
(global_v6_socket_references == 0)) {
close(global_v6_socket);
global_v6_socket = -1;
if (!no_global_v6_socket) {
if (global_v6_socket_references == 0) {
close(global_v6_socket);
global_v6_socket = -1;
log_info("Unbound from *:%d", ntohs(local_port));
log_info("Unbound from *:%d",
(int) ntohs(local_port));
}
#if defined(RELAY_PORT)
if (relay_port && (relay_port_v6_socket_references == 0)) {
close(relay_port_v6_socket);
relay_port_v6_socket = -1;
log_info("Unbound from relay port *:%d",
(int) ntohs(relay_port));
}
#endif
}
}
#endif /* DHCPv6 */
......
......@@ -557,12 +557,6 @@ static struct option dhcpv6_options[] = {
{ "solmax-rt", "L", &dhcpv6_universe, 82, 1 },
{ "inf-max-rt", "L", &dhcpv6_universe, 83, 1 },
#endif
#if defined(RFC7710_OPTIONS)
{ "v6-captive-portal", "t", &dhcpv6_universe, 103, 1 },
#endif
#if defined(RFC6153_OPTIONS)
{ "ipv6-address-andsf", "6A", &dhcpv6_universe, 143, 1 },
#endif
/* RFC7341 OPTIONS */
#if defined(RFC7341_OPTIONS)
......@@ -570,6 +564,16 @@ static struct option dhcpv6_options[] = {
{ "dhcp4-o-dhcp6-server", "6A", &dhcpv6_universe, 88, 1 },
#endif
#if defined(RFC7710_OPTIONS)
{ "v6-captive-portal", "t", &dhcpv6_universe, 103, 1 },
#endif
{ "relay-source-port", "S", &dhcpv6_universe, 135, 1 },
#if defined(RFC6153_OPTIONS)
{ "ipv6-address-andsf", "6A", &dhcpv6_universe, 143, 1 },
#endif
{ NULL, NULL, NULL, 0, 0 }
};
......
......@@ -156,6 +156,9 @@ void if_deregister_send (info)
XXX Changes to the filter program may require changes to the constant
offsets used in if_register_send to patch the UPF program! XXX */
#if defined(RELAY_PORT)
#error "Relay port is not yet supported for UPF"
#endif
void if_register_receive (info)
struct interface_info *info;
......
......@@ -768,6 +768,7 @@ enable_tracing
enable_delayed_ack
enable_dhcpv6
enable_dhcpv4o6
enable_relay_port
enable_paranoia
enable_early_chroot
enable_ipv4_pktinfo
......@@ -1446,6 +1447,7 @@ Optional Features:
--enable-dhcpv6 enable support for DHCPv6 (default is yes)
--enable-dhcpv4o6 enable support for DHCPv4-over-DHCPv6 (default is
no)
--enable-relay-port enable support for relay port (default is no)
--enable-paranoia enable support for chroot/setuid (default is no)
--enable-early-chroot enable chrooting prior to configuration (default is
no)
......@@ -5487,6 +5489,19 @@ else
enable_dhcpv4o6="no"
fi
# Relay port (draft-ietf-dhc-relay-port-10.txt) optional compile-time feature.
# Check whether --enable-relay-port was given.
if test "${enable_relay_port+set}" = set; then :
enableval=$enable_relay_port;
fi
# Relay port is off by default (for now)
if test "$enable_relay_port" = "yes"; then
$as_echo "#define RELAY_PORT 1" >>confdefs.h
fi
# PARANOIA is off by default (until we can test it with all features)
# Check whether --enable-paranoia was given.
if test "${enable_paranoia+set}" = set; then :
......@@ -6207,6 +6222,7 @@ fi
done
# needed for linux/filter.h on old systems
relay_port_supported="no"
ac_fn_c_check_header_compile "$LINENO" "linux/filter.h" "ac_cv_header_linux_filter_h" "
#ifdef HAVE_LINUX_TYPES_H
#include <linux/types.h>
......@@ -6223,6 +6239,7 @@ then
$as_echo "#define HAVE_LPF 1" >>confdefs.h
relay_port_supported="yes"
else
ac_fn_c_check_header_mongrel "$LINENO" "sys/dlpi.h" "ac_cv_header_sys_dlpi_h" "$ac_includes_default"
if test "x$ac_cv_header_sys_dlpi_h" = xyes; then :
......@@ -6247,10 +6264,17 @@ fi
$as_echo "#define HAVE_BPF 1" >>confdefs.h
relay_port_supported="yes"
fi
fi
fi
if test "$enable_relay_port" = "yes"; then
if test "$relay_port_supported" != "yes"; then
as_fn_error $? "--enable-relay-port requires BPF or LPF" "$LINENO" 5
fi
fi
# SIOCGLIFCONF uses some transport structures. Trick is not all platforms
# use the same structures. We like to use 'struct lifconf' and 'struct
# lifreq', but we'll use these other structures if they're present. HPUX
......@@ -9014,6 +9038,7 @@ Features:
dhcpv6: $enable_dhcpv6
delayed-ack: $enable_delayed_ack
dhcpv4o6: $enable_dhcpv4o6
relay-port: $enable_relay_port
Developer:
ATF unittests : $atf_path
......
......@@ -177,6 +177,15 @@ else
enable_dhcpv4o6="no"
fi
# Relay port (draft-ietf-dhc-relay-port-10.txt) optional compile-time feature.
AC_ARG_ENABLE(relay-port,
AS_HELP_STRING([--enable-relay-port],[enable support for relay port (default is no)]))
# Relay port is off by default (for now)
if test "$enable_relay_port" = "yes"; then
AC_DEFINE([RELAY_PORT], [1],
[Define to 1 to include relay port support.])
fi
# PARANOIA is off by default (until we can test it with all features)
AC_ARG_ENABLE(paranoia,
AS_HELP_STRING([--enable-paranoia],[enable support for chroot/setuid (default is no)]))
......@@ -521,6 +530,7 @@ AC_CHECK_HEADERS(ifaddrs.h)
# figure out what IPv4 interface code to use
AC_CHECK_HEADERS(linux/types.h) # needed for linux/filter.h on old systems
relay_port_supported="no"
AC_CHECK_HEADER(linux/filter.h, DO_LPF=1, ,
[
#ifdef HAVE_LINUX_TYPES_H
......@@ -531,6 +541,7 @@ if test -n "$DO_LPF"
then
AC_DEFINE([HAVE_LPF], [1],
[Define to 1 to use the Linux Packet Filter interface code.])
relay_port_supported="yes"
else
AC_CHECK_HEADER(sys/dlpi.h, DO_DLPI=1)
if test -n "$DO_DLPI"
......@@ -544,10 +555,17 @@ else
AC_DEFINE([HAVE_BPF], [1],
[Define to 1 to use the
Berkeley Packet Filter interface code.])
relay_port_supported="yes"
fi
fi
fi
if test "$enable_relay_port" = "yes"; then
if test "$relay_port_supported" != "yes"; then
AC_MSG_ERROR([--enable-relay-port requires BPF or LPF])
fi
fi
# SIOCGLIFCONF uses some transport structures. Trick is not all platforms
# use the same structures. We like to use 'struct lifconf' and 'struct
# lifreq', but we'll use these other structures if they're present. HPUX
......@@ -1035,6 +1053,7 @@ Features:
dhcpv6: $enable_dhcpv6
delayed-ack: $enable_delayed_ack
dhcpv4o6: $enable_dhcpv4o6
relay-port: $enable_relay_port
Developer:
ATF unittests : $atf_path
......
......@@ -178,6 +178,15 @@ else
enable_dhcpv4o6="no"
fi
# Relay port (draft-ietf-dhc-relay-port-10.txt) optional compile-time feature.
AC_ARG_ENABLE(relay-port,
AS_HELP_STRING([--enable-relay-port],[enable support for relay port (default is no)]))
# Relay port is off by default (for now)
if test "$enable_relay_port" = "yes"; then
AC_DEFINE([RELAY_PORT], [1],
[Define to 1 to include relay port support.])
fi
# PARANOIA is off by default (until we can test it with all features)
AC_ARG_ENABLE(paranoia,
AS_HELP_STRING([--enable-paranoia],[enable support for chroot/setuid (default is no)]))
......@@ -522,6 +531,7 @@ AC_CHECK_HEADERS(ifaddrs.h)
# figure out what IPv4 interface code to use
AC_CHECK_HEADERS(linux/types.h) # needed for linux/filter.h on old systems
relay_port_supported="no"
AC_CHECK_HEADER(linux/filter.h, DO_LPF=1, ,
[
#ifdef HAVE_LINUX_TYPES_H
......@@ -532,6 +542,7 @@ if test -n "$DO_LPF"
then
AC_DEFINE([HAVE_LPF], [1],
[Define to 1 to use the Linux Packet Filter interface code.])
relay_port_supported="yes"
else
AC_CHECK_HEADER(sys/dlpi.h, DO_DLPI=1)
if test -n "$DO_DLPI"
......@@ -545,10 +556,17 @@ else
AC_DEFINE([HAVE_BPF], [1],
[Define to 1 to use the
Berkeley Packet Filter interface code.])
relay_port_supported="yes"
fi
fi
fi
if test "$enable_relay_port" = "yes"; then
if test "$relay_port_supported" != "yes"; then
AC_MSG_ERROR([--enable-relay-port requires BPF or LPF])
fi
fi
# SIOCGLIFCONF uses some transport structures. Trick is not all platforms
# use the same structures. We like to use 'struct lifconf' and 'struct
# lifreq', but we'll use these other structures if they're present. HPUX
......@@ -1040,6 +1058,7 @@ Features:
dhcpv6: $enable_dhcpv6
delayed-ack: $enable_delayed_ack
dhcpv4o6: $enable_dhcpv4o6
relay-port: $enable_relay_port
Developer:
ATF unittests : $atf_path
......
......@@ -183,6 +183,15 @@ else
enable_dhcpv4o6="no"
fi
# Relay port (draft-ietf-dhc-relay-port-10.txt) optional compile-time feature.
AC_ARG_ENABLE(relay-port,
AS_HELP_STRING([--enable-relay-port],[enable support for relay port (default is no)]))
# Relay port is off by default (for now)
if test "$enable_relay_port" = "yes"; then
AC_DEFINE([RELAY_PORT], [1],
[Define to 1 to include relay port support.])
fi
# PARANOIA is off by default (until we can test it with all features)
AC_ARG_ENABLE(paranoia,
AS_HELP_STRING([--enable-paranoia],[enable support for chroot/setuid (default is no)]))
......@@ -527,6 +536,7 @@ AC_CHECK_HEADERS(ifaddrs.h)
# figure out what IPv4 interface code to use
AC_CHECK_HEADERS(linux/types.h) # needed for linux/filter.h on old systems
relay_port_supported="no"
AC_CHECK_HEADER(linux/filter.h, DO_LPF=1, ,
[
#ifdef HAVE_LINUX_TYPES_H
......@@ -537,6 +547,7 @@ if test -n "$DO_LPF"
then
AC_DEFINE([HAVE_LPF], [1],
[Define to 1 to use the Linux Packet Filter interface code.])
relay_port_supported="yes"
else
AC_CHECK_HEADER(sys/dlpi.h, DO_DLPI=1)
if test -n "$DO_DLPI"
......@@ -550,10 +561,17 @@ else
AC_DEFINE([HAVE_BPF], [1],
[Define to 1 to use the
Berkeley Packet Filter interface code.])
relay_port_supported="yes"
fi
fi
fi
if test "$enable_relay_port" = "yes"; then
if test "$relay_port_supported" != "yes"; then
AC_MSG_ERROR([--enable-relay-port requires BPF or LPF])
fi
fi
# SIOCGLIFCONF uses some transport structures. Trick is not all platforms
# use the same structures. We like to use 'struct lifconf' and 'struct
# lifreq', but we'll use these other structures if they're present. HPUX
......@@ -1076,6 +1094,7 @@ Features:
dhcpv6: $enable_dhcpv6