From fli@biocandy.shapeshifter.se  Sun Aug 14 15:39:21 2005
Return-Path: <fli@biocandy.shapeshifter.se>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id CE4A616A41F
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 14 Aug 2005 15:39:21 +0000 (GMT)
	(envelope-from fli@biocandy.shapeshifter.se)
Received: from mail.hamnpolare.net (manticore.shapeshifter.se [212.37.5.30])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 5C62143D46
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 14 Aug 2005 15:39:20 +0000 (GMT)
	(envelope-from fli@biocandy.shapeshifter.se)
Received: from localhost (localhost [127.0.0.1])
	by mail.hamnpolare.net (Postfix) with ESMTP id 41D5E1A793
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 14 Aug 2005 17:39:18 +0200 (CEST)
Received: from mail.hamnpolare.net ([127.0.0.1])
 by localhost (manticore.shapeshifter.se [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 33497-14 for <FreeBSD-gnats-submit@freebsd.org>;
 Sun, 14 Aug 2005 17:39:17 +0200 (CEST)
Received: from biocandy.shapeshifter.se (h4n2fls31o270.telia.com [217.208.199.4])
	by mail.hamnpolare.net (Postfix) with ESMTP id 007F71A717
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 14 Aug 2005 17:39:16 +0200 (CEST)
Received: by biocandy.shapeshifter.se (Postfix, from userid 1001)
	id BB8C8415E; Sun, 14 Aug 2005 17:39:15 +0200 (CEST)
Message-Id: <20050814153915.BB8C8415E@biocandy.shapeshifter.se>
Date: Sun, 14 Aug 2005 17:39:15 +0200 (CEST)
From: Fredrik Lindberg <fli+freebsd@shapeshifter.se>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] ndisgen can't cope with .sys-files that begins with a number 
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         84911
>Category:       bin
>Synopsis:       [patch] ndisgen(8) can't cope with .sys-files that begins with a number
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    thompsa
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 14 15:40:18 GMT 2005
>Closed-Date:    Tue Jan 05 22:55:31 UTC 2010
>Last-Modified:  Tue Jan 05 22:55:31 UTC 2010
>Originator:     Fredrik Lindberg
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD biocandy.shapeshifter.se 7.0-CURRENT FreeBSD 7.0-CURRENT #1: Tue Aug 2 19:27:22 CEST 2005 root@biocandy.shapeshifter.se:/usr/obj/usr/src/sys/BIOCANDY-CURRENT i386


	
>Description:
ndisgen uses the basename of the windows drivers .sys-file as an internal
identifier.
This identifier is used as variable names windrv_stub.c which is fine in
most cases, however it will fail to compile if the name of the .sys-file
begins with a number.

>How-To-Repeat:
Pass a .sys-file which begins with a number to ndisgen.

>Fix:
The following patch adds a ndis_ prefix to the affected variables 

Index: ndiscvt/ndiscvt.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/ndiscvt/ndiscvt.c,v
retrieving revision 1.11
diff -r1.11 ndiscvt.c
210c210
< 	    "objcopy --redefine-sym _binary_%s_start=%s_drv_data_start "
---
> 	    "objcopy --redefine-sym _binary_%s_start=ndis_%s_drv_data_start "
212c212
< 	    "--redefine-sym _binary_%s_end=%s_drv_data_end %s.o %s.o\n",
---
> 	    "--redefine-sym _binary_%s_end=ndis_%s_drv_data_end %s.o %s.o\n",
387c387
< 		    "\nextern unsigned char %s_drv_data_start[];\n",
---
> 		    "\nextern unsigned char ndis_%s_drv_data_start[];\n",
390c390
< 		    "%s_drv_data_start;\n\n", sysfile);
---
> 		    "ndis_%s_drv_data_start;\n\n", sysfile);
Index: ndiscvt/ndisgen.sh
===================================================================
RCS file: /home/ncvs/src/usr.sbin/ndiscvt/ndisgen.sh,v
retrieving revision 1.5
diff -r1.5 ndisgen.sh
417,419c417,419
< echo "	-DDRV_DATA_START=${SYSBASE}_drv_data_start \\"		>> ${MAKEFILE}
< echo "	-DDRV_NAME=${SYSBASE} \\"				>> ${MAKEFILE}
< echo "	-DDRV_DATA_END=${SYSBASE}_drv_data_end"			>> ${MAKEFILE}
---
> echo "	-DDRV_DATA_START=ndis_${SYSBASE}_drv_data_start \\"		>> ${MAKEFILE}
> echo "	-DDRV_NAME=ndis_${SYSBASE} \\"				>> ${MAKEFILE}
> echo "	-DDRV_DATA_END=ndis_${SYSBASE}_drv_data_end"			>> ${MAKEFILE}

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: thompsa 
State-Changed-When: Tue Apr 15 04:18:10 UTC 2008 
State-Changed-Why:  
Committed to HEAD, thanks for the patch. 


Responsible-Changed-From-To: freebsd-bugs->thompsa 
Responsible-Changed-By: thompsa 
Responsible-Changed-When: Tue Apr 15 04:18:10 UTC 2008 
Responsible-Changed-Why:  
Grab. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=84911 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/84911: commit references a PR
Date: Tue, 15 Apr 2008 04:17:18 +0000 (UTC)

 thompsa     2008-04-15 04:17:14 UTC
 
   FreeBSD src repository
 
   Modified files:
     usr.sbin/ndiscvt     ndiscvt.c ndisgen.sh 
   Log:
   Use a ndis_ prefix on the C variable instead of directly using the .sys
   filename, this would fail if the filename started with a number.
   
   PR:             bin/84911
   Submitted by:   Fredrik Lindberg
   
   Revision  Changes    Path
   1.14      +4 -4      src/usr.sbin/ndiscvt/ndiscvt.c
   1.6       +3 -3      src/usr.sbin/ndiscvt/ndisgen.sh
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: rpaulo 
State-Changed-When: Tue Jan 5 22:55:03 UTC 2010 
State-Changed-Why:  
patched state timeout 

http://www.freebsd.org/cgi/query-pr.cgi?pr=84911 
>Unformatted:
