From owner-freebsd-bugs Thu Sep 6 5:40:14 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id EDC8437B405 for ; Thu, 6 Sep 2001 05:40:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f86Ce1Z76913; Thu, 6 Sep 2001 05:40:01 -0700 (PDT) (envelope-from gnats) Date: Thu, 6 Sep 2001 05:40:01 -0700 (PDT) Message-Id: <200109061240.f86Ce1Z76913@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Dima Dorfman Subject: Re: bin/29361: startslip can't load if_sl.ko Reply-To: Dima Dorfman Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/29361; it has been noted by GNATS. From: Dima Dorfman To: "Sergey A.Osokin" 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" 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