From owner-freebsd-net@FreeBSD.ORG Mon Jan 30 21:19:34 2006 Return-Path: X-Original-To: freebsd-net@FreeBSD.org Delivered-To: freebsd-net@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 062F116A420 for ; Mon, 30 Jan 2006 21:19:34 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (cell.sick.ru [217.72.144.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2244943D45 for ; Mon, 30 Jan 2006 21:19:32 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (glebius@localhost [127.0.0.1]) by cell.sick.ru (8.13.3/8.13.3) with ESMTP id k0ULJBIt092923 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 31 Jan 2006 00:19:12 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.sick.ru (8.13.3/8.13.1/Submit) id k0ULJBOM092922; Tue, 31 Jan 2006 00:19:11 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.sick.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 31 Jan 2006 00:19:11 +0300 From: Gleb Smirnoff To: Yar Tikhiy Message-ID: <20060130211911.GG90131@FreeBSD.org> Mail-Followup-To: Gleb Smirnoff , Yar Tikhiy , freebsd-net@freebsd.org References: <20060130193937.GG72743@comp.chem.msu.su> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20060130193937.GG72743@comp.chem.msu.su> User-Agent: Mutt/1.5.6i Cc: freebsd-net@FreeBSD.org Subject: Re: Handling flags on vlan(4) 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: Mon, 30 Jan 2006 21:19:34 -0000 On Mon, Jan 30, 2006 at 10:39:38PM +0300, Yar Tikhiy wrote: Y> Presently our vlan(4) driver sets interface's flags to 0 initially Y> and copies a subset of them from the parent interface when the vlan Y> interface is attached to its parent. In particular, copied are flags Y> IFF_BROADCAST and IFF_MULTICAST. This approach has an unpleasant Y> consequence: if you assign IP to vlan before attaching the latter to Y> its parent, IP won't be properly set up on vlanX because the IP code Y> does some special things for IFF_BROADCAST and IFF_MULTICAST Y> interfaces; at least it sets up a broadcast address and joins the Y> all-hosts group. Y> Y> I can see two ways to deal with the problem. The ideal and hard Y> way is to provide hooks to notify upper network stack layers of Y> changes in interface properties. However, I doubt if such feature Y> is called for. The easy and practical way is to set IFF_BROADCAST Y> and IFF_MULTICAST on vlan from the beginning and prohibit vlan from Y> attaching to a non-bcast or non-mcast parent (which wouldn't work Y> anyway.) For now we can use the second way. I see no problems with it. -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE