From owner-freebsd-current@FreeBSD.ORG Wed Aug 10 09:00:44 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB3F6106564A for ; Wed, 10 Aug 2011 09:00:44 +0000 (UTC) (envelope-from qing.li@bluecoat.com) Received: from whisker.bluecoat.com (whisker.bluecoat.com [216.52.23.28]) by mx1.freebsd.org (Postfix) with ESMTP id 6AF618FC15 for ; Wed, 10 Aug 2011 09:00:44 +0000 (UTC) Received: from PWSVL-EXCHTS-02.internal.cacheflow.com (sai-rp.bluecoat.com [10.2.2.126] (may be forged)) by whisker.bluecoat.com (8.14.2/8.14.2) with ESMTP id p7A8mVsR026553 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Wed, 10 Aug 2011 01:48:32 -0700 (PDT) Received: from PWSVL-EXCMBX-01.internal.cacheflow.com ([fe80::15bc:12e2:4676:340f]) by PWSVL-EXCHTS-02.internal.cacheflow.com ([fe80::4910:317f:407:6ecc%14]) with mapi id 14.01.0289.001; Wed, 10 Aug 2011 01:48:26 -0700 From: "Li, Qing" To: Kevin Lo , Svatopluk Kraus Thread-Topic: [patch] Problem with two NIC on same NET (in_scrubprefix: err=17, new prefix add failed) Thread-Index: AQHMVzFioO1K/vmaTESFf9LzVajQjpUVvYtN Date: Wed, 10 Aug 2011 08:48:25 +0000 Message-ID: References: <92B5D566-9816-4134-9358-2306D0F7DAFC@averesystems.com> <1312781293.2521.1.camel@srgsec> , <1312960023.2614.12.camel@srgsec> In-Reply-To: <1312960023.2614.12.camel@srgsec> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [216.52.23.68] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: Jeremiah Lott , "freebsd-current@freebsd.org" , Andrew Boyer Subject: RE: [patch] Problem with two NIC on same NET (in_scrubprefix: err=17, new prefix add failed) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2011 09:00:44 -0000 Hi,=0A= =0A= >=0A= > I've continued with work on two NIC on same NET. Now, with=0A= > point-to-point interfaces too and I have more small fixes which I=0A= > submitted today:=0A= >=0A= > http://www.freebsd.org/cgi/query-pr.cgi?pr=3D159600=0A= >=0A= =0A= The fix is not entirely correct. The "rtinitflags()" could set RTF_HOS= T flag when the interface=0A= type is IFF_LOOPBACK, not necessarily a PPP llink. =0A= =0A= >=0A= > http://www.freebsd.org/cgi/query-pr.cgi?pr=3D159601=0A= > http://www.freebsd.org/cgi/query-pr.cgi?pr=3D159602=0A= > http://www.freebsd.org/cgi/query-pr.cgi?pr=3D159603=0A= >=0A= =0A= I need to run some tests on your patch, but keep in mind the LLE_STATI= C is sort overloaded=0A= to take care of the case where static routes are maintained in the rou= ting table while dynamic =0A= routes are removed when the interface is taken down.=0A= =0A= >=0A= > I have one more related problem, but I'm not sure how complex the fix sho= uld be.=0A= >=0A= > When an interface is marked down a network route is deleted (or=0A= > replaced) and a loopback route persists in routing table. It is OK.=0A= > However, when an interface is marked up again, then a network route is=0A= > installed unconditionally (but error is ignored) and a loopbak route=0A= > is deleted and added immediately and unconditionally too. IMHO, it is=0A= > not correct behaviour. I think that a second half of in_ifinit()=0A= > should be here starting by in_addprefix() call with some small or=0A= > bigger changes.=0A= >=0A= =0A= Unless you have a really good reason, other than code inspection, and= have=0A= a set of test cases, please leave this code alone for now. See below = ...=0A= =0A= >=0A= > Maybe, adding network route and ignoring error could be OK, but=0A= > deleting loopback route should be done under IFA_RTSELF flag is set=0A= > condition (with existing route refcount check). V_useloopback should=0A= > be check before re-adding the route and existing route must be check=0A= > to evaluate refcount correctly. The proposed patch is attached.=0A= >=0A= =0A= Did you read my code comment in "in.c", at line 1115 ?=0A= =0A= >=0A= > However, I prefer to call in_addprefix() (which is static now) instead=0A= > of rtinit() and add some more checks from in_ifinit(). Can you (or=0A= > anyone) review the patch?=0A= >=0A= =0A= There are quite a few cases to cover, including bootp, which takes a d= ifferent code path=0A= than DHCP through the routing code. I would appreciate that you test t= hese cases before =0A= making any code commits. It's taken some time to get the overall routi= ng code stabilized. =0A= There is still a bug in the Radix code that needs fixing.=0A= =0A= -- Qing=0A= =0A= =0A= =0A=