Date: Fri, 10 Jan 1997 12:02:01 -0100 From: "Brian Somers" <brian.somers@utell.net> To: <dhcp-dist@wide.ad.jp> Cc: <brian@awfulhak.demon.co.uk>, <hackers@freebsd.org> Subject: (wide) DHCP negotiation using the REQUEST_IPADDR option Message-ID: <199701101202.MAA10949@ui-gate.utell.co.uk>
next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. ------=_NextPart_000_01BBFEEE.16772840 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I seem to have found a problem with dhcp-1.3beta when DHCP'ing for a windows 95 box (I have little experience, so I don't know if it's just win95). Under windows 95, the dhcp request is sent with the REQUEST_IPADDR option set. Dhcps will try to select an IP address based on the CID before the requested IP, calling select_wcid() from request() in server/dhcps.c. If it finds a match, *and* it has a REQUEST_IPADDR option (reqip.s_addr) that differs from the entry found (res->ip_addr->s_addr), it returns(-1) - not replying to the request. If however, a NAK is returned, the client (win95) will do another dhcp request without the REQUEST_IPADDR option set..... voila IP address altered. I'm not sure about the original logic behind returning -1 above. If anyone's interested in reproducing this, make sure that you delete the arp entry on the server box while the win95 box is shut down..... I wasted a lot of time here ! The (trivial) patch is attached. Note, the freebsd port does not affect this (nor do I know if patches have been submitted for freebsd), although line numbers are probably different. Brian <brian@awfulhak.demon.co.uk> <brian@freebsd.org> Don't __EVER__ lose your sense of humour ------=_NextPart_000_01BBFEEE.16772840 Content-Type: application/octet-stream; name="dhcps.c.patch" Content-Transfer-Encoding: 7bit Content-Description: dhcps.c.patch (PATCH File) Content-Disposition: attachment; filename="dhcps.c.patch" *** dhcps.c.orig Fri Jan 10 11:45:26 1997 --- dhcps.c Fri Jan 10 11:48:57 1997 *************** *** 1586,1594 **** res = NULL; res = select_wcid(DHCPREQUEST, &cid, curr_epoch); ! if (res != NULL && res->ip_addr != NULL && ! res->ip_addr->s_addr == reqip.s_addr) ! goto ack; else if (reqforme == 1) goto nak; else --- 1586,1596 ---- res = NULL; res = select_wcid(DHCPREQUEST, &cid, curr_epoch); ! if (res != NULL && res->ip_addr != NULL) ! if (res->ip_addr->s_addr == reqip.s_addr) ! goto ack; ! else ! goto nak; else if (reqforme == 1) goto nak; else ------=_NextPart_000_01BBFEEE.16772840--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199701101202.MAA10949>