From: Ted Lemon Date: Thu, 12 Sep 1996 22:22:18 +0000 (+0000) Subject: Allow restricted dynamic bootp for known bootp hosts X-Git-Tag: BETA_5_12~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f44c8dcbe2e93c698f6c8bcddbdca00d5526c45b;p=thirdparty%2Fdhcp.git Allow restricted dynamic bootp for known bootp hosts --- diff --git a/bootp.c b/bootp.c index 76d4fc852..08a3fed71 100644 --- a/bootp.c +++ b/bootp.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: bootp.c,v 1.18 1996/09/11 05:50:54 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: bootp.c,v 1.19 1996/09/12 22:22:18 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -104,6 +104,17 @@ void bootp (packet) } } + /* If we've been told not to boot unknown clients, + and we didn't find any host record for this client, + ignore it. */ + if (!hp && !(packet -> shared_network -> + group -> boot_unknown_clients)) { + note ("Ignoring unknown BOOTP client %s", + print_hw_addr (packet -> raw -> htype, + packet -> raw -> hlen, + packet -> raw -> chaddr)); + } + /* If the packet is from a host we don't know and there are no dynamic bootp addresses on the network it came in on, drop it on the floor. */ @@ -155,16 +166,6 @@ void bootp (packet) goto lose; } - /* If we don't have a fixed address for it, drop it. */ - if (!subnet) { - note ("No fixed address for BOOTP host %s (%s)", - print_hw_addr (packet -> raw -> htype, - packet -> raw -> hlen, - packet -> raw -> chaddr), - hp -> name); - return; - } - /* Set up the outgoing packet... */ memset (&outgoing, 0, sizeof outgoing); memset (&raw, 0, sizeof raw); diff --git a/server/bootp.c b/server/bootp.c index 76d4fc852..08a3fed71 100644 --- a/server/bootp.c +++ b/server/bootp.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: bootp.c,v 1.18 1996/09/11 05:50:54 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: bootp.c,v 1.19 1996/09/12 22:22:18 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -104,6 +104,17 @@ void bootp (packet) } } + /* If we've been told not to boot unknown clients, + and we didn't find any host record for this client, + ignore it. */ + if (!hp && !(packet -> shared_network -> + group -> boot_unknown_clients)) { + note ("Ignoring unknown BOOTP client %s", + print_hw_addr (packet -> raw -> htype, + packet -> raw -> hlen, + packet -> raw -> chaddr)); + } + /* If the packet is from a host we don't know and there are no dynamic bootp addresses on the network it came in on, drop it on the floor. */ @@ -155,16 +166,6 @@ void bootp (packet) goto lose; } - /* If we don't have a fixed address for it, drop it. */ - if (!subnet) { - note ("No fixed address for BOOTP host %s (%s)", - print_hw_addr (packet -> raw -> htype, - packet -> raw -> hlen, - packet -> raw -> chaddr), - hp -> name); - return; - } - /* Set up the outgoing packet... */ memset (&outgoing, 0, sizeof outgoing); memset (&raw, 0, sizeof raw);