From owner-freebsd-bugs Thu Sep 27 1: 0:18 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 6BD3537B42F for ; Thu, 27 Sep 2001 01:00:02 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f8R802e48038; Thu, 27 Sep 2001 01:00:02 -0700 (PDT) (envelope-from gnats) Received: from xkulesh.vol.cz (xkulesh.vol.cz [195.250.154.106]) by hub.freebsd.org (Postfix) with ESMTP id 48F0037B406 for ; Thu, 27 Sep 2001 00:51:24 -0700 (PDT) Received: (from root@localhost) by xkulesh.vol.cz (8.11.4/8.11.4) id f8R1gEH43139; Thu, 27 Sep 2001 03:42:14 +0200 (CEST) (envelope-from dan) Message-Id: <200109270142.f8R1gEH43139@xkulesh.vol.cz> Date: Thu, 27 Sep 2001 03:42:14 +0200 (CEST) From: Dan Lukes Reply-To: Dan Lukes To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: bin/30863: bootpd/dovend.c Win95 compatibility improvement and typos in error messages Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 30863 >Category: bin >Synopsis: bootpd/dovend.c Win95 compatibility improvement and typos in error messages >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Sep 27 01:00:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Dan Lukes >Release: FreeBSD 4.4-STABLE i386 >Organization: Obludarium >Environment: System: FreeBSD 4.4-STABLE #31: Thu Sep 20 23:06:53 CEST 2001 i386 >Description: There are several copy&paste typos in NEED macro causing incorrect error messages. Win95 release ignore dn (domain-name) field unless terminated. Padding shouldn't cause a problem on other systems >How-To-Repeat: >Fix: --- libexec/bootpd/dovend.c.orig Sat Aug 28 02:09:17 1999 +++ libexec/bootpd/dovend.c Thu Sep 27 03:34:41 2001 @@ -137,14 +138,17 @@ /* * Check for room for domain_name. Add 2 to account for * TAG_DOMAIN_NAME and length. + * Add one more for a 'PAD' option to make + * the string zero-terminated for Win95 to work. */ len = strlen(hp->domain_name->string); - NEED((len + 2), "dn"); + NEED((len + 3), "dn"); *vp++ = TAG_DOMAIN_NAME; *vp++ = (byte) (len & 0xFF); bcopy(hp->domain_name->string, vp, len); vp += len; - bytesleft -= len + 2; + bytesleft -= len + 3; + *vp++ = '\0'; /* Courtesy to M$ */ } /* * NIS (YP) server and domain @@ -153,7 +157,7 @@ if (insert_ip(TAG_NIS_SERVER, hp->nis_server, &vp, &bytesleft)) - NEED(8, "ds"); + NEED(8, "ys"); } if (hp->flags.nis_domain) { /* @@ -161,7 +165,7 @@ * TAG_NIS_DOMAIN and length. */ len = strlen(hp->nis_domain->string); - NEED((len + 2), "dn"); + NEED((len + 2), "yn"); *vp++ = TAG_NIS_DOMAIN; *vp++ = (byte) (len & 0xFF); bcopy(hp->nis_domain->string, vp, len); @@ -193,7 +197,7 @@ if (insert_ip(TAG_NTP_SERVER, hp->ntp_server, &vp, &bytesleft)) - NEED(8, "ts"); + NEED(8, "nt"); } /* * I wonder: If the hostname were "promoted" into the BOOTP >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message