From owner-freebsd-bugs Sun Jun 22 07:20:05 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id HAA03353 for bugs-outgoing; Sun, 22 Jun 1997 07:20:05 -0700 (PDT) Received: (from gnats@localhost) by hub.freebsd.org (8.8.5/8.8.5) id HAA03318; Sun, 22 Jun 1997 07:20:01 -0700 (PDT) Resent-Date: Sun, 22 Jun 1997 07:20:01 -0700 (PDT) Resent-Message-Id: <199706221420.HAA03318@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, kzmi@ca2.so-net.or.jp Received: from mgate01.so-net.or.jp (mgate01.mx.so-net.or.jp [202.238.95.28]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id HAA02999 for ; Sun, 22 Jun 1997 07:10:21 -0700 (PDT) Received: from mail.ca2.so-net.or.jp (mail.ca2.so-net.or.jp [202.238.95.34]) by mgate01.so-net.or.jp (8.7.5/3.4W397061319) with ESMTP id XAA06465 for ; Sun, 22 Jun 1997 23:09:59 +0900 (JST) Received: from wimpy.local.host (pppbae3.pppp.ap.so-net.or.jp [210.132.186.227]) by mail.ca2.so-net.or.jp (8.7.3/3.4W397052220) with ESMTP id XAA24098 for ; Sun, 22 Jun 1997 23:10:09 +0900 (JST) Received: (from dune@localhost) by wimpy.local.host (8.8.5/3.5Wpl5) id XAA00883; Sun, 22 Jun 1997 23:05:42 +0900 (JST) Message-Id: <199706221405.XAA00883@kzmi.ca2.so-net.or.jp> Date: Sun, 22 Jun 1997 23:05:42 +0900 (JST) From: kzmi@ca2.so-net.or.jp (Iwasa Kazmi) Reply-To: kzmi@ca2.so-net.or.jp To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: bin/3926: ppp can't remove old default route. Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >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 >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 { 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); } ---------- 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 . 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: