Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Sep 2001 05:40:01 -0700 (PDT)
From:      Dima Dorfman <dima@unixfreak.org>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/29361: startslip can't load if_sl.ko 
Message-ID:  <200109061240.f86Ce1Z76913@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

The following reply was made to PR bin/29361; it has been noted by GNATS.

From: Dima Dorfman <dima@unixfreak.org>
To: "Sergey A.Osokin" <osa@FreeBSD.org.ru>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/29361: startslip can't load if_sl.ko 
Date: Thu, 06 Sep 2001 05:32:11 -0700

 "Sergey A.Osokin" <osa@FreeBSD.org.ru> wrote:
 > @@ -428,6 +428,21 @@
 >  	 * Attach
 >  	 */
 >  	printd("setd");
 > +
 > +	/*
 > +	 * Attempt to load the SLIP interface KLD if it isn't loaded
 > +	 * already.
 > +	 */
 > +#if defined(__FreeBSD__) && !defined(NOKLDLOAD)
 
 What's the point of this conditional?  This program doesn't check
 __FreeBSD__ anywhere else, and it operates on a kernel device, so I
 think it's rather pointless.  Ditto for NOKLDLOAD.  The only thing
 that checks these is ppp(8), and ppp(8) *is* expected to work on
 systems other than FreeBSD.  All other programs that do something like
 this (e.g., ccdconfig, ifconfig) don't perform these checks.
 
 > +	if (modfind("if_sl") == -1) {
 > + 		if (kldload("if_sl") == -1) {
 
 You should probably check that the module was really loaded, since the
 mapping between klds and modules isn't clear.  For example, the
 "if_sl" module doesn't have to exist in the file called if_sl.ko.
 Most other programs do something like this:
 
         if (modfind(MODULE) < 0) {
                 /* Not present in kernel, try loading it */
                 if (kldload(MODULE) < 0 || modfind(MODULE) < 0)
                         warn("module not available!");
 
 Ignore the "< 0" tests; those are wrong.  They should be "== -1" like
 in your patch.
 
 > +			syslog(LOG_ERR, "kldload if_sl: %s\n",
 > +			   strerror(errno));
 > +			down(2);
 
 As above, most programs don't consider it a fatal error if they can't
 find the module.  I don't see why this should, either.
 
 Thanks.

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?200109061240.f86Ce1Z76913>