diff options
Diffstat (limited to 'contrib/isc-dhcp/common/socket.c')
-rw-r--r-- | contrib/isc-dhcp/common/socket.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/contrib/isc-dhcp/common/socket.c b/contrib/isc-dhcp/common/socket.c index 3d1b8f40f8c7..0a6b0b83f559 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 */ |