From kzmi@ca2.so-net.or.jp  Sun Jun 22 07:10:22 1997
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 <FreeBSD-gnats-submit@freebsd.org>; 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 <FreeBSD-gnats-submit@freebsd.org>; 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 <FreeBSD-gnats-submit@freebsd.org>; 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
Subject: ppp can't remove old default route.
X-Send-Pr-Version: 3.2

>Number:         3926
>Category:       bin
>Synopsis:       /usr/sbin/ppp can't remove old default route.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    brian
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jun 22 07:20:00 PDT 1997
>Closed-Date:    Sun Jun 22 08:04:24 PDT 1997
>Last-Modified:  Sun Jun 22 08:05:12 PDT 1997
>Originator:     Iwasa Kazmi <kzmi@ca2.so-net.or.jp>
>Release:        FreeBSD 2.2-STABLE i386
>Organization:
(none)
>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.

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: brian 
State-Changed-When: Sun Jun 22 08:04:24 PDT 1997 
State-Changed-Why:  
Fixed June 20. 


Responsible-Changed-From-To: freebsd-bugs->brian 
Responsible-Changed-By: brian 
Responsible-Changed-When: Sun Jun 22 08:04:24 PDT 1997 
Responsible-Changed-Why:  
Fixed June 20. 
>Unformatted:
