Date: Sun, 22 Jun 1997 23:05:42 +0900 (JST) From: kzmi@ca2.so-net.or.jp (Iwasa Kazmi) To: FreeBSD-gnats-submit@FreeBSD.ORG Subject: bin/3926: ppp can't remove old default route. Message-ID: <199706221405.XAA00883@kzmi.ca2.so-net.or.jp> Resent-Message-ID: <199706221420.HAA03318@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 3926 >Category: bin >Synopsis: /usr/sbin/ppp can't remove old default route. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Jun 22 07:20:00 PDT 1997 >Last-Modified: >Originator: Iwasa Kazmi <kzmi@ca2.so-net.or.jp> >Organization: (none) >Release: FreeBSD 2.2-STABLE i386 >Environment: I use one modem (33600bps) for dialup IP connection. I stand /usr/sbin/ppp (iijppp) with destination label only. ( not on-demand or mode ) I use CHAP, but I also tried with no authentication protocol. >Description: If PPP negotiation succeed, new default route is set to alternate gateway. new route is : 0.0.0.0 --> xx.xx.xx.xx (gateway addr) (tun0) When close the connection or quit the process, this route must be deleted. But, this default route is remained after quit the ppp. If ppp was stand next time, the old default route is not removed, so new gateway address is not set. >How-To-Repeat: >Fix: In source code "ppp/route.c", function "void DeleteIfRoutes()" ---------- BEGIN { <snip> if (dstnet.s_addr == INADDR_ANY) { gateway.s_addr = INADDR_ANY; mask = INADDR_ANY; } maddr.s_addr = htonl(mask); OsSetRoute(RTM_DELETE, dstnet, gateway, maddr); <snip> } ---------- END ( This code is also exist in original iij-ppp v0.94 ) This function is called to delete routes before set alternate gataway address, or before quit the process, etc. In above part, when destaddr == INADDR_ANY is true, gateway-addr and mask is set to INADDR_ANY. INADDR_ANY is defined as 0.0.0.0 in <netinet/in.h>. So, if this function was called to delete the default route which routed to another gateway, this function try to delete default route which gateway is 0.0.0.0 --- and it fail. ( I think that there is no problem in "routed"... ) I delete "if(...){...}" sequence above, then it seems that the problem was fixed... I'm not a expert of the network or IP routings. I have no idea about a necessity of this operations of gateway-addr and mask. >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199706221405.XAA00883>