From owner-freebsd-current Fri Oct 25 12:35:47 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BA2AA37BD36 for ; Fri, 25 Oct 2002 12:35:44 -0700 (PDT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 45C0343E3B for ; Fri, 25 Oct 2002 12:35:44 -0700 (PDT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:brdavis@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.3/8.12.3) with ESMTP id g9PJZNs7005694; Fri, 25 Oct 2002 12:35:23 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.3/8.12.3/Submit) id g9PJZMeF005693; Fri, 25 Oct 2002 12:35:22 -0700 Date: Fri, 25 Oct 2002 12:35:22 -0700 From: Brooks Davis To: Bakul Shah Cc: Brooks Davis , Dave Evans , freebsd-current@FreeBSD.ORG Subject: Re: pppd not working on latest current 2002-10-20 Message-ID: <20021025123522.B23521@Odin.AC.HMC.Edu> References: <20021025113137.A23521@Odin.AC.HMC.Edu> <200210251841.OAA09782@valiant.cnchost.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="H1spWtNR+x+ondvy" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200210251841.OAA09782@valiant.cnchost.com>; from bakul@bitblocks.com on Fri, Oct 25, 2002 at 11:41:33AM -0700 X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --H1spWtNR+x+ondvy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 25, 2002 at 11:41:33AM -0700, Bakul Shah wrote: > Until pppd is taught to create the interface if one doesn't > exist, this information needs to be in /usr/src/UPDATING. pppd doesn't need to be taught to create the interface. Rather it needed to learn to check for ppp support in a non-stupid way. The following patch should do it as well as making pppd do the right thing when support isn't compiled in, but a module is available. It should make things work with a GENERIC kernel. If someone who actually uses pppd could test it, perferably in both sceneios, I'll see about getting it commited. -- Brooks Index: sys-bsd.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/cvs/src/usr.sbin/pppd/sys-bsd.c,v retrieving revision 1.18 diff -u -p -r1.18 sys-bsd.c --- sys-bsd.c 17 Sep 2002 15:52:35 -0000 1.18 +++ sys-bsd.c 25 Oct 2002 19:30:20 -0000 @@ -44,6 +44,7 @@ static char rcsid[] =3D "$FreeBSD: src/usr #include #include #include +#include #ifdef NetBSD1_2 #include #endif @@ -169,28 +170,24 @@ sys_check_options() } =20 /* - * ppp_available - check whether the system has any ppp interfaces - * (in fact we check whether we can do an ioctl on ppp0). + * ppp_available - check whether the system has the ppp module loaded + * or compiled in. If it doesn't try loading it before giving up. */ int ppp_available() { - int s, ok; - struct ifreq ifr; - extern char *no_ppp_msg; + const char *modname =3D "if_ppp"; + + if (modfind(modname) !=3D -1) { + printf("module is loaded\n"); + return 1; + } =20 - if ((s =3D socket(AF_INET, SOCK_DGRAM, 0)) < 0) - return 1; /* can't tell */ + printf("trying to load ppp mode\n"); + if (kldload(modname) !=3D -1) + return 1; =20 - strncpy(ifr.ifr_name, "ppp0", sizeof (ifr.ifr_name)); - ok =3D ioctl(s, SIOCGIFFLAGS, (caddr_t) &ifr) >=3D 0; - close(s); - - no_ppp_msg =3D "\ -This system lacks kernel support for PPP. To include PPP support\n\ -in the kernel, please follow the steps detailed in the README.bsd\n\ -file in the ppp-2.2 distribution.\n"; - return ok; + return 0; } =20 /* --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --H1spWtNR+x+ondvy Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE9uZz6XY6L6fI4GtQRAmvcAJ0V/mIHLzxEKAbRjAX6qWDZB7ZahgCgtrIr bcMIwYGO7X2L8bMouhREYwk= =gU6X -----END PGP SIGNATURE----- --H1spWtNR+x+ondvy-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message