From owner-freebsd-net@FreeBSD.ORG Wed Dec 24 15:56:50 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80AF41065670; Wed, 24 Dec 2008 15:56:50 +0000 (UTC) (envelope-from ianf@clue.co.za) Received: from inbound01.jnb1.gp-online.net (inbound01.jnb1.gp-online.net [41.161.16.135]) by mx1.freebsd.org (Postfix) with ESMTP id 14DE08FC18; Wed, 24 Dec 2008 15:56:49 +0000 (UTC) (envelope-from ianf@clue.co.za) Received: from [41.241.124.20] (helo=clue.co.za) by inbound01.jnb1.gp-online.net with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1LFW6I-0000mv-ID; Wed, 24 Dec 2008 17:56:46 +0200 Received: from localhost ([127.0.0.1] helo=clue.co.za) by clue.co.za with esmtp (Exim 4.69 (FreeBSD)) (envelope-from ) id 1LFW6C-0000uF-5C; Wed, 24 Dec 2008 17:56:40 +0200 To: Bruce Simpson From: Ian FREISLICH In-Reply-To: <49524131.7010700@incunabulum.net> References: <49524131.7010700@incunabulum.net> <494FAFAC.90802@FreeBSD.org> X-Attribution: BOFH Date: Wed, 24 Dec 2008 17:56:40 +0200 Message-Id: Cc: Gerald Pfeifer , Vladimir Grebenschikov , Kip Macy , Qing Li , freebsd-net@freebsd.org, freebsd-current@freebsd.org, Sergey Matveychuk Subject: Re: HEADSUP: arp-v2 has been committed X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 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, 24 Dec 2008 15:56:50 -0000 Bruce Simpson wrote: > Ian FREISLICH wrote: > > ... > > I can't quite remember exactly why imr_ifindex doesn't work, but > > on my hosts which have several hundred interfaces and my OSPF > > sessions are never on the interface that has the default route, > > until I explicitly set the imr_address, the kernel always chooses > > the interface which has the default route. > > > > Do you have applications which do not explicitly specify the interface > address to use for multicast group joins? > > If they do not, that's a bug in the application -- IPv4 and IPv6 > multicast *requires* that a link be specified somehow, either using the > new APIs which take an ifindex, or an IPv4 "primary address". quagga does specify the ifindex passed in a struct ip_mreqn in the imr_ifindex member to setsockopt, which reading the documentation should be sufficient, yet it is not. I have checked that it does set the correct ifindex. Setting the IP address in the imr_address member of the same struct correctly chooses the interface. > Unfortunately there has been historical breakage in the multicast APIs. > There are some apps which run before all interfaces have been ifconfig'd > up in the system, and they need to create multicast sockets. > > The kernel behaviour you describe is historical and I had to reintroduce > it to avoid breaking such applications. It is a kludge which we probably > can't retire until their developers fix their multicast apps to be aware > of multiple interfaces on the system. Is this the BSD struct ip_mreq hack? This particular code isn't using that. Ian -- Ian Freislich