From owner-freebsd-net@FreeBSD.ORG Wed Oct 16 19:21:21 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 499A8189 for ; Wed, 16 Oct 2013 19:21:21 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-qc0-x22f.google.com (mail-qc0-x22f.google.com [IPv6:2607:f8b0:400d:c01::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0B3742511 for ; Wed, 16 Oct 2013 19:21:20 +0000 (UTC) Received: by mail-qc0-f175.google.com with SMTP id v2so1007454qcr.20 for ; Wed, 16 Oct 2013 12:21:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=y35y+J9iPg8UO4Ms51l8+xoyVI3o4XyCpRSMeYB8c2o=; b=BUMyB8J/bXy4v3iSv/jZJXoUEfkrZTSPNjFTMgawa8I7N46vj2u0Kzp7GlT4C+EwO6 5fCNDOE0n+3UUF6VcLwmpcN0VGFsUHa8UgmQCwzyzoL6ZZ9Zd2r2uYrfdOcQLQVOtrGH OcBmarYphvM8fAmg3uaBZUXnv8R1a/HbglzATF1ZZyLlT9n1GfyMGzLefyejyob/PZ37 bTGVz3R/DrU293IGaVWsqThzWNDng3ZbLD2QiYGuNiNHyJRbBSujdflJy9qst8PuAOrA d2PGekuR6UjE+tw/2zhmscXsDDDkjGoOJeODAiEWuIfXA3mPbc+6nKOno/k7IrPqsk0z fV3w== MIME-Version: 1.0 X-Received: by 10.224.14.79 with SMTP id f15mr4513869qaa.113.1381951280187; Wed, 16 Oct 2013 12:21:20 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.49.39.97 with HTTP; Wed, 16 Oct 2013 12:21:20 -0700 (PDT) In-Reply-To: References: Date: Wed, 16 Oct 2013 13:21:20 -0600 X-Google-Sender-Auth: ZqrRwq19NBHy_Jqpy-EdUvoDO1s Message-ID: Subject: Re: ifconfig: ioctl (SIOCAIFADDR): File exists - but not only with alias command From: Alan Somers To: Raimundo Santos Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-net@freebsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Oct 2013 19:21:21 -0000 On Wed, Oct 16, 2013 at 1:13 PM, Raimundo Santos wrote: > On 16 October 2013 15:54, Alan Somers wrote: > >> >> >> I ran into the same problem, on a system with LAGGs, multiple FIBs and >> multiple aliases per interface. I believe that the problem was due to >> a race condition in the kernel. Two process tried to SIOCAIFADDR with >> the same address simultaneously. The second one of them failed and >> printed the error message that you see. But due to the race, the >> first process reported success, yet the interface did not get the >> address. Unfortunately, I was unable to locate the race. My solution >> was to prevent two processes from trying to initialize the interface >> at the same time. The first process was our custom management >> software, which calls "service netif cloneup lagg0" and "service netif >> start lagg0" in rapid succession. The second process was devd, which >> was trying to initialize the newly attached lagg0 interface. I >> commented out the following lines in /etc/devd.conf and the problem >> went away. I don't know if this will solve your problem, but I >> recommend that you use dtrace or some other method to determine >> whether two processes are trying to SIOCAIFADDR at the same time. >> >> notify 0 { >> match "system" "IFNET"; >> match "type" "ATTACH"; >> action "/etc/pccard_ether $subsystem start"; >> }; >> >> > Hey Alan! > > Well, I don`t think it is the problem here. I just try to do a very simple > ifconfig, nothing more, there are no private applications running (I have > postgres siting around and munin gathering sysinfo to me). I was thinking > about some problem in the interaction ifconfig/adresses + routed, but this > is very strange. > > In a less destructive test (the first one took me to reboot the machine), I > see a confusing behavior: > > . put a alias into an igb1 > . remove this alias (-alias) > . printing the main (#0) FIB, nothing is there related to the removed alias > . put the same alias again > . get the File exists result and no configuration of an alias over the igb1 > . but now, listing the main routing table, there are info about that > alias!, but in another port of the NIC, igb2 > > How is this possible? It's sad to say, but the fib code is pretty buggy. Without diving into the source, one thing that you could try is the net.add_addr_allfibs tunable. I think that it defaults to 1. If you set it to 0, then adding an interface address in one fib will not cause it to create routes in other fibs. Does that help?