From owner-freebsd-net@FreeBSD.ORG Fri Sep 21 00:03:38 2007 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8291E16A417 for ; Fri, 21 Sep 2007 00:03:38 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from heff.fud.org.nz (203-109-251-39.static.bliink.ihug.co.nz [203.109.251.39]) by mx1.freebsd.org (Postfix) with ESMTP id 3A67E13C461 for ; Fri, 21 Sep 2007 00:03:38 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: by heff.fud.org.nz (Postfix, from userid 1001) id 434341CC2C; Fri, 21 Sep 2007 12:03:37 +1200 (NZST) Date: Fri, 21 Sep 2007 12:03:37 +1200 From: Andrew Thompson To: FreeBSD-net Message-ID: <20070921000337.GB46172@heff.fud.org.nz> References: <20070920235427.GA46172@heff.fud.org.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070920235427.GA46172@heff.fud.org.nz> User-Agent: Mutt/1.5.13 (2006-08-11) Subject: Re: ifconfig patch X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2007 00:03:38 -0000 On Fri, Sep 21, 2007 at 11:54:27AM +1200, Andrew Thompson wrote: > Hi, > > > I have been digging into why the edsc module wasnt being loaded by > ifconfig and now have a patch. > > A few printfs showed the problem. > > # ifconfig edsc0 create > ifmaybeload(edsc0) > trying to find if_edsc or edsc0 > found @ ed > > Its comparing using the string length of the module name so any partial > matches are going through. I have changed it so it strips the number > from the interface name and uses the full string to match. > > I want to ask re@ soon so any feedback would be great. > > > Andrew > *dp = 0; > > + /* trim the interface number off the end */ > + strcpy(ifname, name); oops, that should have been strlcpy(ifname, name, sizeof(ifname)); > + for (dp = ifname; *dp != 0; dp++) > + if (isdigit(*dp)) > + *dp = '\0'; > + Andrew