From owner-freebsd-mobile Thu Aug 23 9:56:32 2001 Delivered-To: freebsd-mobile@freebsd.org Received: from air.linkclub.or.jp (air.linkclub.or.jp [210.250.19.40]) by hub.freebsd.org (Postfix) with ESMTP id 6D51B37B408; Thu, 23 Aug 2001 09:56:22 -0700 (PDT) (envelope-from toshi@jp.FreeBSD.org) Received: from localhost.jp.FreeBSD.org (1Cust160.tnt1.hanno.jp.da.uu.net [63.12.195.160]) by air.linkclub.or.jp (8.11.4/8.11.4) with ESMTP id f7NGu3W55206; Fri, 24 Aug 2001 01:56:04 +0900 (JST) (envelope-from toshi@jp.FreeBSD.org) Date: Fri, 24 Aug 2001 01:53:24 +0900 (JST) Message-Id: <200108231653.f7NGrO802605.toshi@jp.FreeBSD.org> From: Toshihiko ARAI To: nate@yogotech.com (Nate Williams) Cc: freebsd-mobile@FreeBSD.org, imp@FreeBSD.org Subject: Re: Documentation for rc.conf's removable_interfaces? In-Reply-To: <15234.48176.6699.983659@nomad.yogotech.com> References: <15228.2988.181554.313833@nomad.yogotech.com> <200108200357.f7K3vMn18594.toshi@jp.FreeBSD.org> <15233.22136.524384.459698@nomad.yogotech.com> <200108211348.f7LDmTh30188.toshi@jp.FreeBSD.org> <15234.48176.6699.983659@nomad.yogotech.com> X-Mailer: VM 5.96 (beta) / Mule 2.3 (SUETSUMUHANA) based on 19.34.1 Mime-Version: 1.0 (generated by tm-edit 7.106) Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org + <15234.48176.6699.983659@nomad.yogotech.com>, Nate Williams wrote: > This is good. However, there is still one more problem with the file as > it exists. If a default_router exists, it will not be used because of > the following lines. > # Add default route into $static_routes > case ${defaultrouter} in > [Nn][Oo] | '') > ;; > *) > static_routes="default ${static_routes}" > route_default="default ${defaultrouter}" > ;; > esac > However, I'm not sure what the purpose of adding 'default' to > static_routes is, and unfortunately 'route_default' is not used anywhere > in the file. > Can you explain what is intended here? 'route_default' variable is used with following eval line. Because '${i}' is element of '${static_routes}', in this case 'route_${i}' is substituted for 'route_default'. I referred to 'network_pass1' function of /etc/rc.network, it is around 330th line. # Set up any static routes if specified if [ -n "${static_routes}" ]; then for i in ${static_routes}; do eval route_args=\$route_${i} route add ${route_args} done fi > ps. The below patch is good, although it may be necessary to do a route > flush in certain cases. When I do hot-plug of PC-card Ethernet and USB Ethernet with more than one environment, former route is left and may become a problem. Therefore I was able to control it with 'removable_route_flush' variable. There is a method to add 'removable_route_flush=NO' to /etc/defaults/rc.conf, but which is better compared with below patch? >> - # Clean the routing table >> - case ${removable_route_flush} in >> - [Nn][Oo]) >> - ;; >> - *) >> - # flush beforehand, just in case.... >> - route -n flush -inet >> - ;; >> - esac -- Toshihiko ARAI To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message