From owner-freebsd-current@FreeBSD.ORG Wed Aug 3 14:51:34 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 3725F106564A for ; Wed, 3 Aug 2011 14:51:34 +0000 (UTC) (envelope-from onwahe@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id F1D538FC1B for ; Wed, 3 Aug 2011 14:51:33 +0000 (UTC) Received: by ywm39 with SMTP id 39so625772ywm.13 for ; Wed, 03 Aug 2011 07:51:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=ccAwgmdnsv1tluyby0JEMqXjfwq/nOO8YdSD8CHbucI=; b=x7BRjzoSbddOREgoh14uMLmxcQMNEEaL00UMCxZ5s5u43GuTcxYzeSJXnOZ/JsR2BD vpzi6Q+EZzs+bSUXU9B3KcqlDDAu89dDmbKRtE2V7yj4Z2RsTZubBy8cZQft9Ilh1JsO B2QxzNg1gGsWnYTkIT6P0dlcfCxm5m5iIOpO8= MIME-Version: 1.0 Received: by 10.142.229.17 with SMTP id b17mr2777744wfh.443.1312383093031; Wed, 03 Aug 2011 07:51:33 -0700 (PDT) Received: by 10.142.49.1 with HTTP; Wed, 3 Aug 2011 07:51:32 -0700 (PDT) Date: Wed, 3 Aug 2011 16:51:32 +0200 Message-ID: From: Svatopluk Kraus To: freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: [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, 03 Aug 2011 14:51:34 -0000 I have two NIC on same NET (both are up). If a NIC which installs network route is going down then an error happens during network route replacement (in_scrubprefix: err=17, new prefix add failed). I've done a little bit investigation. In rtinit1(), before rtrequest1_fib() is called, info.rti_flags is initialized by flags (function argument) or-ed with ifa->ifa_flags. Both NIC has a loopback route to itself, so IFA_RTSELF is set on ifa(s). As IFA_RTSELF is defined by RTF_HOST, rtrequest1_fib() is called with RTF_HOST flag even if netmask is not NULL. Consequently, netmask is set to zero in rtrequest1_fib(), and request to add network route is changed under hands to request to add host route. It is the reason of logged info and my problem. When I've done more investigation, it looks similar to http://svnweb.freebsd.org/base?view=revision&revision=201543. So, I propose the following patch. Index: sys/net/route.c =================================================================== --- sys/net/route.c (revision 224635) +++ sys/net/route.c (working copy) @@ -1478,7 +1478,7 @@ */ bzero((caddr_t)&info, sizeof(info)); info.rti_ifa = ifa; - info.rti_flags = flags | ifa->ifa_flags; + info.rti_flags = flags | (ifa->ifa_flags & ~IFA_RTSELF); info.rti_info[RTAX_DST] = dst; /* * doing this for compatibility reason Is the patch sufficient? Svata