Bug 82491 - [patch] bootpd(8) shouldn't ignore requests
Summary: [patch] bootpd(8) shouldn't ignore requests
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 5.4-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-21 18:20 UTC by Walter C. Pelissero
Modified: 2018-01-03 05:13 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Walter C. Pelissero 2005-06-21 18:20:17 UTC
	Bootpd ignores request packets when bp_sname is filled with
	blanks.  Even if that may be in violation of some RFC it
	should assume the bp_sname is unset and thus answer the
	request.

Fix: Apply the following patch to bootpd.c

RCS file: /usr/src.cvs/src/libexec/bootpd/bootpd.c,v
retrieving revision 1.22


I haven't investigated whether the bp_sname should be null
	terminated at all, but I assume it should as the rest of the
	code relies on it.  Otherwise a loop like the following could
	be a better idea (not tested!):

	for (n = sizeof(bp->bp_sname) - 1; n >= 0 && bp->bp_sname[n] == ' '; --n)
            bp->bp_sname[n] = '\0';--llehF4AebgTnx19GAtm9iq9PNYv6mpx8X0wTkOP6noOdZpp9
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

diff -u -r1.22 bootpd.c
--- bootpd.c    13 Feb 2004 09:26:54 -0000      1.22
+++ bootpd.c    21 Jun 2005 16:49:27 -0000
@@ -643,6 +643,7 @@
         * If we're not being addressed, ignore this request.
         * If the server name field is null, throw in our name.
         */
+       if (bp->bp_sname[0] == ' ') bp->bp_sname[0] = '\0';
        if (strlen(bp->bp_sname)) {
                if (strcmp(bp->bp_sname, hostname)) {
                        if (debug)
How-To-Repeat: 	Send a bootp packet while bootpd is running with -d option.
	It should display something like:

	bootpd: info(6):   bootptab mtime: Tue Jun 21 18:18:58 2005
	bootpd: info(6):   reading "/etc/bootptab"
	bootpd: info(6):   read 2 entries (2 hosts) from "/etc/bootptab"
	bootpd: info(6):   recvd pkt from IP addr 0.0.0.0
	bootpd: info(6):   bootptab mtime: Tue Jun 21 18:18:58 2005
	bootpd: info(6):   ignoring request for server                                  from client at Ethernet address 08:00:3E:26:4B:EA

	There are at least some Openfirmwares around that send a
	bp_sname filled with blanks.
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:58:55 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped