From: Ted Lemon Date: Sat, 8 Jan 2000 01:47:37 +0000 (+0000) Subject: Add support for NetWare/IP encapsulated option. X-Git-Tag: V3-BETA-2-PATCH-1~439 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df598b3e4daedcdb8ad59255114ad90c3d22d48a;p=thirdparty%2Fdhcp.git Add support for NetWare/IP encapsulated option. --- diff --git a/server/dhcp.c b/server/dhcp.c index fd1e52411..ccb35cf98 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -22,7 +22,7 @@ #ifndef lint static char copyright[] = -"$Id: dhcp.c,v 1.131 2000/01/05 18:16:36 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; +"$Id: dhcp.c,v 1.132 2000/01/08 01:47:37 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -626,6 +626,23 @@ void dhcpinform (packet) } } + /* Make an encapsulation for the NWIP suboptions if the client + asked for them. */ + i = DHO_NWIP_SUBOPTIONS; + if (!lookup_option (&dhcp_universe, options, i)) { + oc = (struct option_cache *)0; + if (option_cache_allocate (&oc, "dhcpinform")) { + memset (&d1, 0, sizeof d1); + d1.data = "nwip"; + d1.len = 4; + if (make_encapsulation (&oc -> expression, &d1)) { + oc -> option = dhcp_universe.options [i]; + save_option (&dhcp_universe, options, oc); + } + option_cache_dereference (&oc, "dhcpinform"); + } + } + /* If we've been given a vendor option space, and there's something in it, and we weren't given a vendor-encapsulated-options option, then cons one up. */ @@ -1787,6 +1804,24 @@ void ack_lease (packet, lease, offer, when, msg) option_cache_dereference (&oc, "ack_lease"); } + /* Make an encapsulation for the NWIP suboptions if the client + asked for them. */ + i = DHO_NWIP_SUBOPTIONS; + if (!(oc = lookup_option (&dhcp_universe, state -> options, i))) { + oc = (struct option_cache *)0; + if (option_cache_allocate (&oc, "dhcpinform")) { + memset (&d1, 0, sizeof d1); + d1.data = "nwip"; + d1.len = 4; + if (make_encapsulation (&oc -> expression, &d1)) { + oc -> option = dhcp_universe.options [i]; + save_option (&dhcp_universe, + state -> options, oc); + } + option_cache_dereference (&oc, "dhcpinform"); + } + } + /* If we've been given a vendor option space, and there's something in it, and we weren't given a vendor-encapsulated-options option, then cons one up. */