Date: Fri, 21 Sep 2007 12:03:37 +1200 From: Andrew Thompson <thompsa@FreeBSD.org> To: FreeBSD-net <freebsd-net@freebsd.org> Subject: Re: ifconfig patch Message-ID: <20070921000337.GB46172@heff.fud.org.nz> In-Reply-To: <20070920235427.GA46172@heff.fud.org.nz> References: <20070920235427.GA46172@heff.fud.org.nz>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070921000337.GB46172>