From owner-freebsd-bugs@FreeBSD.ORG Tue Jun 21 17:20:18 2005 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2468C16A41C for ; Tue, 21 Jun 2005 17:20:18 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id DD3FC43D55 for ; Tue, 21 Jun 2005 17:20:17 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j5LHKHZr079415 for ; Tue, 21 Jun 2005 17:20:17 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j5LHKHWi079414; Tue, 21 Jun 2005 17:20:17 GMT (envelope-from gnats) Resent-Date: Tue, 21 Jun 2005 17:20:17 GMT Resent-Message-Id: <200506211720.j5LHKHWi079414@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, walter@pelissero.de Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4C4BA16A41C for ; Tue, 21 Jun 2005 17:15:34 +0000 (GMT) (envelope-from walter.pelissero@iesy.net) Received: from smtp.iesy.net (mta002.iesy.net [81.210.131.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id D7A1B43D1F for ; Tue, 21 Jun 2005 17:15:31 +0000 (GMT) (envelope-from walter.pelissero@iesy.net) Received: from zaphod.home.loc (unknown [81.210.131.48]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.iesy.net (Postfix) with ESMTP id 091D6B531 for ; Tue, 21 Jun 2005 19:15:27 +0200 (CEST) Received: from zaphod.home.loc (localhost [127.0.0.1]) by zaphod.home.loc (8.13.3/8.13.3) with ESMTP id j5LHFQ6E056973 for ; Tue, 21 Jun 2005 19:15:26 +0200 (CEST) (envelope-from wcp@zaphod.home.loc) Received: (from wcp@localhost) by zaphod.home.loc (8.13.3/8.13.1/Submit) id j5LHFPbe056972; Tue, 21 Jun 2005 19:15:25 +0200 (CEST) (envelope-from wcp) Message-Id: <200506211715.j5LHFPbe056972@zaphod.home.loc> Date: Tue, 21 Jun 2005 19:15:25 +0200 (CEST) From: "Walter C. Pelissero" To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: misc/82491: bootpd shouldn't ignore requests X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: walter@pelissero.de List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2005 17:20:18 -0000 >Number: 82491 >Category: misc >Synopsis: bootpd shouldn't ignore requests >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jun 21 17:20:17 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Walter C. Pelissero >Release: FreeBSD 5.4-STABLE i386 >Organization: >Environment: System: FreeBSD zaphod.home.loc 5.4-STABLE FreeBSD 5.4-STABLE #1: Mon Jun 13 14:43:15 CEST 2005 root@zaphod.home.loc:/usr/src/sys/i386/compile/TYAN-TIGER-MP i386 >Description: 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. >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. >Fix: Apply the following patch to bootpd.c RCS file: /usr/src.cvs/src/libexec/bootpd/bootpd.c,v retrieving revision 1.22 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) 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'; >Release-Note: >Audit-Trail: >Unformatted: