From owner-freebsd-isdn Mon Apr 2 9:56:25 2001 Delivered-To: freebsd-isdn@freebsd.org Received: from mout0.freenet.de (mout0.freenet.de [194.97.50.131]) by hub.freebsd.org (Postfix) with ESMTP id D558037B71A; Mon, 2 Apr 2001 09:56:11 -0700 (PDT) (envelope-from netchild@leidinger.net) Received: from [194.97.50.138] (helo=mx0.freenet.de) by mout0.freenet.de with esmtp (Exim 3.22 #1) id 14k7cd-0007Tc-00; Mon, 02 Apr 2001 18:56:07 +0200 Received: from a2ec4.pppool.de ([213.6.46.196] helo=Magelan.Leidinger.net) by mx0.freenet.de with esmtp (Exim 3.22 #1) id 14k7cd-0007B4-00; Mon, 02 Apr 2001 18:56:07 +0200 Received: from Leidinger.net (netchild@localhost [127.0.0.1]) by Magelan.Leidinger.net (8.11.3/8.11.3) with ESMTP id f32Gq1I02500; Mon, 2 Apr 2001 18:52:02 +0200 (CEST) (envelope-from netchild@Leidinger.net) Message-Id: <200104021652.f32Gq1I02500@Magelan.Leidinger.net> Date: Mon, 2 Apr 2001 18:52:00 +0200 (CEST) From: Alexander Leidinger Subject: Re: Recent interface/routing changes breaks on-demand PPP (+sppp) To: ru@FreeBSD.org Cc: net@FreeBSD.org, isdn@freebsd.org In-Reply-To: <20010331204534.B11966@sunbay.com> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by Magelan.Leidinger.net id f32Gq1I02500 Sender: owner-freebsd-isdn@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On 31 M=E4r, Ruslan Ermilov wrote: [-isdn CCed,] Dear -isdn readers, we are talking about the actual behavior of -current, see -current and -net for the beginning of the discussion. >> >> If I use >> >> route add default -interface isp1 >> >> I wan't to have the packets routed trough isp1. I don't care about = how >> >> the routing table is held consistent, but I if the route is discard= ed >> >> without my interaction it not only violates POLA, in this case it's >> >> prohibits a valid use of the -interface feature (dial on demand via= sppp >> >> is broken at the moment). >> >>=20 >> > OK, finally got it. When the interface goes down, the address is st= ill >> > valid, and there is no reason to delete (static?) routes that use th= is >> > address, but the new code does. I was confused by the code comment = below >>=20 >> I didn't have a static IP address. The only static thing in this conte= xt >> is the interface the defaultroute is assigned to. At every >> dial-on-demand I get another IP. >>=20 > Well, if address is deleted from an interface, all routes that use it > will be invalidated (deleted) to avoid using the wrong address. This > patch only fixes interface down/up case, when address does not change. If "isp1" is a valid address in this context: it doesn't change. Here a little bit of cut&paste (your "#if 0" patch is applied) which perhaps gives you a hint what I have here: ---snip--- (3) netchild@ttyp1 % ifconfig isp1 isp1: flags=3Da010 mtu 1500 inet 0.0.0.0 --> 0.0.0.1 netmask 0xffff0000=20 ether 00:00:00:00:00:00 (4) netchild@ttyp1 % netstat -rn Routing tables Internet: Destination Gateway Flags Refs Use Netif Ex= pire default 0:0:0:0:0:0 USc 0 1 isp1 0.0.0.1 0.0.0.0 UH 0 0 isp1 127.0.0.1 127.0.0.1 UH 2 4613 lo0 192.168.1 link#1 UC 1 0 ed0 =3D= > (5) netchild@ttyp1 % isdn-up # this is a SUID wrapper for "ifconfig isp= 1 up" (6) netchild@ttyp1 % ifconfig isp1 isp1: flags=3Da011 mtu 1500 inet 0.0.0.0 --> 0.0.0.1 netmask 0xffff0000=20 ether 00:00:00:00:00:00=20 (7) netchild@ttyp1 % netstat -rn =20 Routing tables Internet: Destination Gateway Flags Refs Use Netif Ex= pire default 0:0:0:0:0:0 USc 0 1 isp1 0.0.0.1 0.0.0.0 UH 0 0 isp1 0.0.0.2 0.0.0.0 UH 0 0 isp0 127.0.0.1 127.0.0.1 UH 2 4613 lo0 192.168.1 link#1 UC 1 0 ed0 =3D= > ---snip--- isp1 gets a new IP address after the ppp negotiation of sppp/isdnd. 0.0.0.0 -> 0.0.0.1 uses a documented hack in the i4b stack which discards the first packet to don't let go a packet with a wrong address (0.0.0.0) out of the computer. After a timeout or an "ifconfig isp1 down" it hangs up and the dynamic IP address of isp1 get's replaced by 0.0.0.0 again. The actual behavior of -current breaks the documented way of enabling dial-on-demand with sppp/isdnd. (To -isdn readers: after the first "ifconfig isp1 down" the defaultroute vanishes, after a manual "route add default -interface isp1" the route stays even with subsequent "ifconfig isp1 down", doing an additional "route add ..." is annoying, needs additional privileges and violates POLA) Bye, Alexander. --=20 Actually, Microsoft is sort of a mixture between the Borg and the Ferengi. http://www.Leidinger.net Alexander @ Leidinger.net GPG fingerprint =3D C518 BC70 E67F 143F BE91 3365 79E2 9C60 B006 3FE7 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isdn" in the body of the message