From owner-freebsd-current@FreeBSD.ORG Wed Aug 10 07:44:05 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 E4AF9106564A for ; Wed, 10 Aug 2011 07:44:05 +0000 (UTC) (envelope-from kevlo@kevlo.org) Received: from ns.kevlo.org (kevlo.org [220.128.136.52]) by mx1.freebsd.org (Postfix) with ESMTP id B0B1C8FC08 for ; Wed, 10 Aug 2011 07:44:03 +0000 (UTC) Received: from [127.0.0.1] (kevlo@kevlo.org [220.128.136.52]) by ns.kevlo.org (8.14.3/8.14.3) with ESMTP id p7A774HQ023856; Wed, 10 Aug 2011 15:07:05 +0800 (CST) From: Kevin Lo To: Svatopluk Kraus In-Reply-To: References: <92B5D566-9816-4134-9358-2306D0F7DAFC@averesystems.com> <1312781293.2521.1.camel@srgsec> Content-Type: text/plain; charset="us-ascii" Date: Wed, 10 Aug 2011 15:07:03 +0800 Message-ID: <1312960023.2614.12.camel@srgsec> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit 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 07:44:06 -0000 On Mon, 2011-08-08 at 16:57 +0200, Svatopluk Kraus wrote: > Thanks for committing the fix. > > I've continued with work on two NIC on same NET. Now, with > point-to-point interfaces too and I have more small fixes which I > submitted today: > > http://www.freebsd.org/cgi/query-pr.cgi?pr=159600 > http://www.freebsd.org/cgi/query-pr.cgi?pr=159601 > http://www.freebsd.org/cgi/query-pr.cgi?pr=159602 > http://www.freebsd.org/cgi/query-pr.cgi?pr=159603 > > I have one more related problem, but I'm not sure how complex the fix should be. > > When an interface is marked down a network route is deleted (or > replaced) and a loopback route persists in routing table. It is OK. > However, when an interface is marked up again, then a network route is > installed unconditionally (but error is ignored) and a loopbak route > is deleted and added immediately and unconditionally too. IMHO, it is > not correct behaviour. I think that a second half of in_ifinit() > should be here starting by in_addprefix() call with some small or > bigger changes. > > Maybe, adding network route and ignoring error could be OK, but > deleting loopback route should be done under IFA_RTSELF flag is set > condition (with existing route refcount check). V_useloopback should > be check before re-adding the route and existing route must be check > to evaluate refcount correctly. The proposed patch is attached. > > However, I prefer to call in_addprefix() (which is static now) instead > of rtinit() and add some more checks from in_ifinit(). Can you (or > anyone) review the patch? Hi Svatopluk, Thanks for working so hard to figure the issue out. kern/159600 looks good to me also, committed to HEAD. The rest needs more review, thanks! > Thanks once again, > > Svata Kevin