summaryrefslogtreecommitdiffstats
path: root/contrib/isc-dhcp/common
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2000-06-26 08:06:22 +0000
committerobrien <obrien@FreeBSD.org>2000-06-26 08:06:22 +0000
commit8bf3d0eae63400031a65954b5b5f2f7c49757d1a (patch)
treeec3f0e70f9b53e452616b0ada4af4616056c1884 /contrib/isc-dhcp/common
parentbb7cda744509ca00fdfaacff74526af8928253b4 (diff)
downloadFreeBSD-src-8bf3d0eae63400031a65954b5b5f2f7c49757d1a.zip
FreeBSD-src-8bf3d0eae63400031a65954b5b5f2f7c49757d1a.tar.gz
Import Patchlevel 1 of the ISC 2.0 dhcp client.
Diffstat (limited to 'contrib/isc-dhcp/common')
-rw-r--r--contrib/isc-dhcp/common/Makefile.dist206
-rw-r--r--contrib/isc-dhcp/common/dispatch.c9
-rw-r--r--contrib/isc-dhcp/common/ethernet.c8
-rw-r--r--contrib/isc-dhcp/common/lpf.c5
-rw-r--r--contrib/isc-dhcp/common/options.c20
-rw-r--r--contrib/isc-dhcp/common/raw.c18
-rw-r--r--contrib/isc-dhcp/common/socket.c31
7 files changed, 268 insertions, 29 deletions
diff --git a/contrib/isc-dhcp/common/Makefile.dist b/contrib/isc-dhcp/common/Makefile.dist
new file mode 100644
index 0000000..1e3e062
--- /dev/null
+++ b/contrib/isc-dhcp/common/Makefile.dist
@@ -0,0 +1,206 @@
+# Makefile.dist
+#
+# Copyright (c) 1996, 1999 The Internet Software Consortium.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. Neither the name of The Internet Software Consortium nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
+# CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+# BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+# THE INTERNET SOFTWARE CONSORTIUM OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+# OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+CATMANPAGES = dhcp-options.cat5
+SEDMANPAGES = dhcp-options.man5
+SRC = raw.c parse.c nit.c icmp.c dispatch.c conflex.c upf.c bpf.c socket.c \
+ lpf.c packet.c memory.c print.c options.c inet.c convert.c \
+ tree.c tables.c hash.c alloc.c errwarn.c inet_addr.c dlpi.c \
+ tr.c ethernet.c
+OBJ = raw.o parse.o nit.o icmp.o dispatch.o conflex.o upf.o bpf.o socket.o \
+ lpf.o packet.o memory.o print.o options.o inet.o convert.o \
+ tree.o tables.o hash.o alloc.o errwarn.o inet_addr.o dlpi.o \
+ tr.o ethernet.o
+MAN = dhcp-options.5
+
+DEBUG = -g
+INCLUDES = -I.. -I../includes
+CFLAGS = $(DEBUG) $(PREDEFINES) $(INCLUDES) $(COPTS)
+
+all: libdhcp.a $(CATMANPAGES)
+
+libdhcp.a: $(OBJ)
+ rm -f libdhcp.a
+ ar cruv libdhcp.a $(OBJ)
+ ranlib libdhcp.a
+
+install: all
+ for dir in $(FFMANDIR); do \
+ foo=""; \
+ for bar in `echo $(DESTDIR)$${dir} |tr / ' '`; do \
+ foo=$${foo}/$$bar; \
+ if [ ! -d $$foo ]; then \
+ mkdir $$foo; \
+ chmod 755 $$foo; \
+ fi; \
+ done; \
+ done
+ $(MANINSTALL) $(MANFROM) dhcp-options.$(MANCAT)5 $(MANTO) \
+ $(DESTDIR)$(FFMANDIR)/dhcp-options$(FFMANEXT)
+
+
+clean:
+ -rm -f $(OBJ)
+
+realclean: clean
+ -rm -f libdhcp.a *~ #* $(CATMANPAGES) $(SEDMANPAGES)
+
+distclean: realclean
+ -rm -f Makefile
+
+dhcp-options.cat5: dhcp-options.man5
+ nroff -man dhcp-options.man5 >dhcp-options.cat5
+
+dhcp-options.man5: dhcp-options.5
+ sed -e "s#ETCDIR#$(ETC)#g" -e "s#DBDIR#$(VARDB)#g" \
+ -e "s#RUNDIR#$(VARRUN)#g" < dhcp-options.5 >dhcp-options.man5
+
+# Dependencies (semi-automatically-generated)
+
+raw.o: raw.c ../includes/dhcpd.h \
+ ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \
+ ../includes/cf/netbsd.h ../includes/dhcp.h \
+ ../includes/tree.h ../includes/hash.h ../includes/inet.h \
+ ../includes/sysconf.h
+parse.o: parse.c ../includes/dhcpd.h \
+ ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \
+ ../includes/cf/netbsd.h \
+ ../includes/dhcp.h ../includes/tree.h ../includes/hash.h ../includes/inet.h \
+ ../includes/sysconf.h ../includes/dhctoken.h
+nit.o: nit.c ../includes/dhcpd.h \
+ ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \
+ ../includes/cf/netbsd.h ../includes/dhcp.h \
+ ../includes/tree.h ../includes/hash.h ../includes/inet.h \
+ ../includes/sysconf.h
+icmp.o: icmp.c ../includes/dhcpd.h \
+ ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \
+ ../includes/cf/netbsd.h ../includes/dhcp.h \
+ ../includes/tree.h ../includes/hash.h ../includes/inet.h \
+ ../includes/sysconf.h ../includes/netinet/ip.h \
+ ../includes/netinet/ip_icmp.h
+dispatch.o: dispatch.c ../includes/dhcpd.h \
+ ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \
+ ../includes/cf/netbsd.h ../includes/dhcp.h \
+ ../includes/tree.h ../includes/hash.h ../includes/inet.h \
+ ../includes/sysconf.h \
+ conflex.c ../includes/dhcpd.h \
+ ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \
+ ../includes/cf/netbsd.h ../includes/dhcp.h \
+ ../includes/tree.h ../includes/hash.h ../includes/inet.h \
+ ../includes/sysconf.h ../includes/dhctoken.h
+upf.o: upf.c ../includes/dhcpd.h \
+ ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \
+ ../includes/cf/netbsd.h ../includes/dhcp.h \
+ ../includes/tree.h ../includes/hash.h ../includes/inet.h \
+ ../includes/sysconf.h
+bpf.o: bpf.c ../includes/dhcpd.h \
+ ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \
+ ../includes/cf/netbsd.h ../includes/dhcp.h \
+ ../includes/tree.h ../includes/hash.h ../includes/inet.h \
+ ../includes/sysconf.h ../includes/netinet/ip.h ../includes/netinet/udp.h \
+ ../includes/netinet/if_ether.h
+socket.o: socket.c ../includes/dhcpd.h \
+ ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \
+ ../includes/cf/netbsd.h ../includes/dhcp.h \
+ ../includes/tree.h ../includes/hash.h ../includes/inet.h \
+ ../includes/sysconf.h
+lpf.o: lpf.c ../includes/dhcpd.h \
+ ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \
+ ../includes/cf/netbsd.h ../includes/dhcp.h \
+ ../includes/tree.h ../includes/hash.h ../includes/inet.h \
+ ../includes/sysconf.h
+packet.o: packet.c ../includes/dhcpd.h \
+ ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \
+ ../includes/cf/netbsd.h ../includes/dhcp.h \
+ ../includes/tree.h ../includes/hash.h ../includes/inet.h \
+ ../includes/sysconf.h ../includes/netinet/ip.h \
+ ../includes/netinet/udp.h ../includes/netinet/if_ether.h
+memory.o: memory.c ../includes/dhcpd.h \
+ ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \
+ ../includes/cf/netbsd.h ../includes/dhcp.h \
+ ../includes/tree.h ../includes/hash.h ../includes/inet.h \
+ ../includes/sysconf.h
+print.o: print.c ../includes/dhcpd.h \
+ ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \
+ ../includes/cf/netbsd.h ../includes/dhcp.h \
+ ../includes/tree.h ../includes/hash.h ../includes/inet.h \
+ ../includes/sysconf.h
+options.o: options.c ../includes/dhcpd.h \
+ ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \
+ ../includes/cf/netbsd.h ../includes/dhcp.h \
+ ../includes/tree.h ../includes/hash.h ../includes/inet.h \
+ ../includes/sysconf.h
+inet.o: inet.c ../includes/dhcpd.h \
+ ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \
+ ../includes/cf/netbsd.h ../includes/dhcp.h \
+ ../includes/tree.h ../includes/hash.h ../includes/inet.h \
+ ../includes/sysconf.h
+convert.o: convert.c ../includes/dhcpd.h \
+ ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \
+ ../includes/cf/netbsd.h ../includes/dhcp.h \
+ ../includes/tree.h ../includes/hash.h ../includes/inet.h \
+ ../includes/sysconf.h
+tree.o: tree.c ../includes/dhcpd.h \
+ ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \
+ ../includes/cf/netbsd.h ../includes/dhcp.h \
+ ../includes/tree.h ../includes/hash.h ../includes/inet.h \
+ ../includes/sysconf.h
+tables.o: tables.c ../includes/dhcpd.h \
+ ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \
+ ../includes/cf/netbsd.h ../includes/dhcp.h \
+ ../includes/tree.h ../includes/hash.h ../includes/inet.h \
+ ../includes/sysconf.h
+hash.o: hash.c ../includes/dhcpd.h \
+ ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \
+ ../includes/cf/netbsd.h ../includes/dhcp.h \
+ ../includes/tree.h ../includes/hash.h ../includes/inet.h \
+ ../includes/sysconf.h
+alloc.o: alloc.c ../includes/dhcpd.h \
+ ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \
+ ../includes/cf/netbsd.h ../includes/dhcp.h \
+ ../includes/tree.h ../includes/hash.h ../includes/inet.h \
+ ../includes/sysconf.h
+errwarn.o: errwarn.c ../includes/dhcpd.h \
+ ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \
+ ../includes/cf/netbsd.h ../includes/dhcp.h \
+ ../includes/tree.h ../includes/hash.h ../includes/inet.h \
+ ../includes/sysconf.h
+inet_addr.o: inet_addr.c ../includes/dhcpd.h \
+ ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \
+ ../includes/cf/netbsd.h ../includes/dhcp.h \
+ ../includes/tree.h ../includes/hash.h ../includes/inet.h \
+ ../includes/sysconf.h
+dlpi.o: dlpi.c ../includes/dhcpd.h \
+ ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \
+ ../includes/cf/netbsd.h ../includes/dhcp.h \
+ ../includes/tree.h ../includes/hash.h ../includes/inet.h \
+ ../includes/sysconf.h
diff --git a/contrib/isc-dhcp/common/dispatch.c b/contrib/isc-dhcp/common/dispatch.c
index cdf7ef5..d44a987 100644
--- a/contrib/isc-dhcp/common/dispatch.c
+++ b/contrib/isc-dhcp/common/dispatch.c
@@ -42,7 +42,7 @@
#ifndef lint
static char copyright[] =
-"$Id: dispatch.c,v 1.47.2.14 1999/03/29 22:16:36 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: dispatch.c,v 1.47.2.15 1999/07/13 12:51:55 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -456,9 +456,10 @@ void discover_interfaces (state)
if (!tmp -> shared_network && (state == DISCOVER_SERVER)) {
warn ("No subnet declaration for %s (%s).",
tmp -> name, inet_ntoa (foo.sin_addr));
- warn ("Please write a subnet declaration for the %s",
- "network segment to");
- error ("which interface %s is attached.", tmp -> name);
+ warn ("Please write a subnet declaration in your %s",
+ "dhcpd.conf file for the");
+ error ("network segment to which interface %s %s",
+ tmp -> name, "is attached.");
}
/* Find subnets that don't have valid interface
diff --git a/contrib/isc-dhcp/common/ethernet.c b/contrib/isc-dhcp/common/ethernet.c
index 311c3c9..41c0a30 100644
--- a/contrib/isc-dhcp/common/ethernet.c
+++ b/contrib/isc-dhcp/common/ethernet.c
@@ -42,7 +42,7 @@
#ifndef lint
static char copyright[] =
-"$Id: ethernet.c,v 1.1.2.1 1999/05/27 17:35:47 mellon Exp $ Copyright (c) 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: ethernet.c,v 1.1.2.2 1999/11/11 16:10:41 mellon Exp $ Copyright (c) 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -79,8 +79,8 @@ void assemble_ethernet_header (interface, buf, bufix, to)
eh.ether_type = htons (ETHERTYPE_IP);
#endif
- memcpy (&buf [*bufix], &eh, sizeof eh);
- *bufix += sizeof eh;
+ memcpy (&buf [*bufix], &eh, ETHER_HEADER_SIZE);
+ *bufix += ETHER_HEADER_SIZE;
}
#endif /* PACKET_ASSEMBLY */
@@ -95,7 +95,7 @@ ssize_t decode_ethernet_header (interface, buf, bufix, from)
{
struct ether_header eh;
- memcpy (&eh, buf + bufix, sizeof eh);
+ memcpy (&eh, buf + bufix, ETHER_HEADER_SIZE);
#ifdef USERLAND_FILTER
if (ntohs (eh.ether_type) != ETHERTYPE_IP)
diff --git a/contrib/isc-dhcp/common/lpf.c b/contrib/isc-dhcp/common/lpf.c
index 9e56684..14dd21a 100644
--- a/contrib/isc-dhcp/common/lpf.c
+++ b/contrib/isc-dhcp/common/lpf.c
@@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
-"$Id: lpf.c,v 1.1.2.9 1999/05/27 17:44:52 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: lpf.c,v 1.1.2.10 1999/10/25 15:39:02 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -155,6 +155,9 @@ extern int dhcp_bpf_filter_len;
extern struct sock_filter dhcp_bpf_tr_filter [];
extern int dhcp_bpf_tr_filter_len;
+static void lpf_gen_filter_setup (struct interface_info *);
+static void lpf_tr_filter_setup (struct interface_info *);
+
void if_register_receive (info)
struct interface_info *info;
{
diff --git a/contrib/isc-dhcp/common/options.c b/contrib/isc-dhcp/common/options.c
index 21e1359..b80ffa1 100644
--- a/contrib/isc-dhcp/common/options.c
+++ b/contrib/isc-dhcp/common/options.c
@@ -42,7 +42,7 @@
#ifndef lint
static char copyright[] =
-"$Id: options.c,v 1.26.2.10 1999/05/06 21:54:34 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n";
+"$Id: options.c,v 1.26.2.11 2000/06/24 07:24:02 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#define DHCP_OPTION_DATA
@@ -550,8 +550,22 @@ char *pretty_print_option (code, data, len, emit_commas, emit_quotes)
case 't':
if (emit_quotes)
*op++ = '"';
- strcpy (op, (char *)dp);
- op += strlen ((char *)dp);
+ for (; dp < data + len; dp++) {
+ if (!isascii (*dp) ||
+ !isprint (*dp)) {
+ sprintf (op, "\\%03o",
+ *dp);
+ op += 4;
+ } else if (*dp == '"' ||
+ *dp == '\'' ||
+ *dp == '$' ||
+ *dp == '`' ||
+ *dp == '\\') {
+ *op++ = '\\';
+ *op++ = *dp;
+ } else
+ *op++ = *dp;
+ }
if (emit_quotes)
*op++ = '"';
*op = 0;
diff --git a/contrib/isc-dhcp/common/raw.c b/contrib/isc-dhcp/common/raw.c
index 9274980..0ef9289 100644
--- a/contrib/isc-dhcp/common/raw.c
+++ b/contrib/isc-dhcp/common/raw.c
@@ -54,7 +54,7 @@
#ifndef lint
static char copyright[] =
-"$Id: raw.c,v 1.11.2.3 1999/04/06 16:00:24 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: raw.c,v 1.11.2.4 1999/07/20 20:03:10 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -79,8 +79,14 @@ void if_register_send (info)
/* List addresses on which we're listening. */
if (!quiet_interface_discovery)
- note ("Sending on %s, port %d",
- piaddr (info -> address), htons (local_port));
+ note ("Sending on Raw Socket/%s/%s%s%s",
+ info -> name,
+ print_hw_addr (info -> hw_address.htype,
+ info -> hw_address.hlen,
+ info -> hw_address.haddr),
+ (info -> shared_network ? "/" : ""),
+ (info -> shared_network ?
+ info -> shared_network -> name : ""));
if ((sock = socket (AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0)
error ("Can't create dhcp socket: %m");
@@ -141,6 +147,12 @@ int can_unicast_without_arp ()
return 1;
}
+int can_receive_unicast_unconfigured (ip)
+ struct interface_info *ip;
+{
+ return 1;
+}
+
void maybe_setup_fallback ()
{
}
diff --git a/contrib/isc-dhcp/common/socket.c b/contrib/isc-dhcp/common/socket.c
index 3d1b8f4..0a6b0b8 100644
--- a/contrib/isc-dhcp/common/socket.c
+++ b/contrib/isc-dhcp/common/socket.c
@@ -50,16 +50,17 @@
#ifndef lint
static char copyright[] =
-"$Id: socket.c,v 1.26.2.11 1999/03/29 22:07:14 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: socket.c,v 1.26.2.12 1999/10/25 15:39:55 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
#ifdef USE_SOCKET_FALLBACK
-# define USE_SOCKET_SEND
+# if !defined (USE_SOCKET_SEND)
# define if_register_send if_register_fallback
# define send_packet send_fallback
# define if_reinitialize_send if_reinitialize_fallback
+# endif
#endif
static int once = 0;
@@ -67,7 +68,7 @@ static int once = 0;
/* Reinitializes the specified interface after an address change. This
is not required for packet-filter APIs. */
-#ifdef USE_SOCKET_SEND
+#if defined (USE_SOCKET_SEND) || defined (USE_SOCKET_FALLBACK)
void if_reinitialize_send (info)
struct interface_info *info;
{
@@ -93,7 +94,9 @@ void if_reinitialize_receive (info)
}
#endif
-#if defined (USE_SOCKET_SEND) || defined (USE_SOCKET_RECEIVE)
+#if defined (USE_SOCKET_SEND) || \
+ defined (USE_SOCKET_RECEIVE) || \
+ defined (USE_SOCKET_FALLBACK)
/* Generic interface registration routine... */
int if_register_socket (info)
struct interface_info *info;
@@ -147,9 +150,9 @@ int if_register_socket (info)
return sock;
}
-#endif /* USE_SOCKET_SEND || USE_SOCKET_RECEIVE */
+#endif /* USE_SOCKET_SEND || USE_SOCKET_RECEIVE || USE_SOCKET_FALLBACK */
-#ifdef USE_SOCKET_SEND
+#if defined (USE_SOCKET_SEND) || defined (USE_SOCKET_FALLBACK)
void if_register_send (info)
struct interface_info *info;
{
@@ -165,7 +168,7 @@ void if_register_send (info)
(info -> shared_network ?
info -> shared_network -> name : ""));
}
-#endif /* USE_SOCKET_SEND */
+#endif /* USE_SOCKET_SEND || USE_SOCKET_FALLBACK */
#ifdef USE_SOCKET_RECEIVE
void if_register_receive (info)
@@ -183,7 +186,7 @@ void if_register_receive (info)
}
#endif /* USE_SOCKET_RECEIVE */
-#ifdef USE_SOCKET_SEND
+#if defined (USE_SOCKET_SEND) || defined (USE_SOCKET_FALLBACK)
ssize_t send_packet (interface, packet, raw, len, from, to, hto)
struct interface_info *interface;
struct packet *packet;
@@ -215,7 +218,7 @@ ssize_t send_packet (interface, packet, raw, len, from, to, hto)
}
return result;
}
-#endif /* USE_SOCKET_SEND */
+#endif /* USE_SOCKET_SEND || USE_SOCKET_FALLBACK */
#ifdef USE_SOCKET_RECEIVE
ssize_t receive_packet (interface, buf, len, from, hfrom)
@@ -244,7 +247,7 @@ ssize_t receive_packet (interface, buf, len, from, hfrom)
}
#endif /* USE_SOCKET_RECEIVE */
-#ifdef USE_SOCKET_SEND
+#if defined (USE_SOCKET_FALLBACK)
/* This just reads in a packet and silently discards it. */
void fallback_discard (protocol)
@@ -261,9 +264,9 @@ void fallback_discard (protocol)
if (status < 0)
warn ("fallback_discard: %m");
}
-#endif /* USE_SOCKET_SEND */
+#endif /* USE_SOCKET_FALLBACK */
-#if defined (USE_SOCKET_SEND) && !defined (USE_SOCKET_FALLBACK)
+#if defined (USE_SOCKET_SEND)
int can_unicast_without_arp ()
{
return 0;
@@ -284,7 +287,7 @@ int can_receive_unicast_unconfigured (ip)
void maybe_setup_fallback ()
{
-#if defined (SO_BINDTODEVICE)
+#if defined (USE_SOCKET_FALLBACK)
struct interface_info *fbi;
fbi = setup_fallback ();
if (fbi) {
@@ -294,4 +297,4 @@ void maybe_setup_fallback ()
}
#endif
}
-#endif /* USE_SOCKET_SEND && !USE_SOCKET_FALLBACK */
+#endif /* USE_SOCKET_SEND */
OpenPOWER on IntegriCloud