Date: Thu, 27 Sep 2001 03:42:14 +0200 (CEST) From: Dan Lukes <dan@obluda.cz> To: FreeBSD-gnats-submit@freebsd.org Subject: bin/30863: bootpd/dovend.c Win95 compatibility improvement and typos in error messages Message-ID: <200109270142.f8R1gEH43139@xkulesh.vol.cz>
next in thread | raw e-mail | index | archive | help
>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 <NUL> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200109270142.f8R1gEH43139>