From 7ba1204fc74e707005fa5c8efb9245dc11c1c43c Mon Sep 17 00:00:00 2001 From: Ted Lemon Date: Mon, 29 Mar 1999 22:07:14 +0000 Subject: [PATCH] Add can_receive_unicast_unconfigured --- common/bpf.c | 8 +++++++- common/dlpi.c | 6 ++++++ common/lpf.c | 24 +++++++++++++++++------- common/nit.c | 8 +++++++- common/socket.c | 12 +++++++++++- common/upf.c | 8 +++++++- 6 files changed, 55 insertions(+), 11 deletions(-) diff --git a/common/bpf.c b/common/bpf.c index 38234064b..d1c3b1a7b 100644 --- a/common/bpf.c +++ b/common/bpf.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: bpf.c,v 1.19.2.8 1999/02/23 22:09:56 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; +"$Id: bpf.c,v 1.19.2.9 1999/03/29 22:07:12 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -418,6 +418,12 @@ int can_unicast_without_arp () return 1; } +int can_receive_unicast_unconfigured (ip) + struct interface_info *ip; +{ + return 1; +} + void maybe_setup_fallback () { struct interface_info *fbi; diff --git a/common/dlpi.c b/common/dlpi.c index f566b0397..a493a3c96 100644 --- a/common/dlpi.c +++ b/common/dlpi.c @@ -1247,6 +1247,12 @@ int can_unicast_without_arp () return 1; } +int can_receive_unicast_unconfigured (ip) + struct interface_info *ip; +{ + return 1; +} + void maybe_setup_fallback () { struct interface_info *fbi; diff --git a/common/lpf.c b/common/lpf.c index 72531c922..4deecf85f 100644 --- a/common/lpf.c +++ b/common/lpf.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: lpf.c,v 1.1.2.7 1999/03/26 16:44:12 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; +"$Id: lpf.c,v 1.1.2.8 1999/03/29 22:07:13 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -92,10 +92,12 @@ int if_register_lpf (info) if ((sock = socket(PF_PACKET, SOCK_PACKET, htons(ETH_P_ALL))) < 0) { if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT || errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT || - errno == EAFNOSUPPORT || errno == EINVAL) - error ("socket: %m - make sure %s %s!", - "CONFIG_PACKET and CONFIG_FILTER are defined", + errno == EAFNOSUPPORT || errno == EINVAL) { + warn ("socket: %m"); + error ("Make sure to set %s %s!", + "CONFIG_PACKET=y and CONFIG_FILTER=y", "in your kernel configuration"); + } error("Open a socket for LPF: %m"); } @@ -106,10 +108,12 @@ int if_register_lpf (info) if (bind (sock, &sa, sizeof sa)) { if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT || errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT || - errno == EAFNOSUPPORT || errno == EINVAL) - error ("socket: %m - make sure %s %s!", - "CONFIG_PACKET and CONFIG_FILTER are defined", + errno == EAFNOSUPPORT || errno == EINVAL) { + warn ("bind: %m"); + error ("Set %s %s!", + "CONFIG_PACKET=y and CONFIG_FILTER=y", "in your kernel configuration"); + } error("Bind socket to interface: %m"); } @@ -280,6 +284,12 @@ int can_unicast_without_arp () return 1; } +int can_receive_unicast_unconfigured (ip) + struct interface_info *ip; +{ + return 1; +} + void maybe_setup_fallback () { struct interface_info *fbi; diff --git a/common/nit.c b/common/nit.c index 047f2a11a..77f43b38d 100644 --- a/common/nit.c +++ b/common/nit.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: nit.c,v 1.15.2.3 1999/02/23 22:09:54 mellon Exp $ Copyright (c) 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: nit.c,v 1.15.2.4 1999/03/29 22:07:14 mellon Exp $ Copyright (c) 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -360,6 +360,12 @@ int can_unicast_without_arp () return 1; } +int can_receive_unicast_unconfigured (ip) + struct interface_info *ip; +{ + return 1; +} + void maybe_setup_fallback () { struct interface_info *fbi; diff --git a/common/socket.c b/common/socket.c index 8e1b274b6..3d1b8f40f 100644 --- a/common/socket.c +++ b/common/socket.c @@ -50,7 +50,7 @@ #ifndef lint static char copyright[] = -"$Id: socket.c,v 1.26.2.10 1999/02/23 22:09:55 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; +"$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"; #endif /* not lint */ #include "dhcpd.h" @@ -269,6 +269,16 @@ int can_unicast_without_arp () return 0; } +int can_receive_unicast_unconfigured (ip) + struct interface_info *ip; +{ +#if defined (SOCKET_CAN_RECEIVE_UNICAST_UNCONFIGURED) + return 1; +#else + return 0; +#endif +} + /* If we have SO_BINDTODEVICE, set up a fallback interface; otherwise, do not. */ diff --git a/common/upf.c b/common/upf.c index c2f28c928..70f8efff1 100644 --- a/common/upf.c +++ b/common/upf.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: upf.c,v 1.3.2.4 1999/03/26 16:53:50 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; +"$Id: upf.c,v 1.3.2.5 1999/03/29 22:07:13 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -311,6 +311,12 @@ int can_unicast_without_arp () return 1; } +int can_receive_unicast_unconfigured (ip) + struct interface_info *ip; +{ + return 1; +} + void maybe_setup_fallback () { struct interface_info *fbi; -- 2.47.3