From owner-freebsd-net@FreeBSD.ORG Mon Jan 30 19:39:53 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 D54F816A420 for ; Mon, 30 Jan 2006 19:39:53 +0000 (GMT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (comp.chem.msu.su [158.250.32.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id AF68743D55 for ; Mon, 30 Jan 2006 19:39:49 +0000 (GMT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (localhost [127.0.0.1]) by comp.chem.msu.su (8.13.3/8.13.3) with ESMTP id k0UJdfpx015467 for ; Mon, 30 Jan 2006 22:39:41 +0300 (MSK) (envelope-from yar@comp.chem.msu.su) Received: (from yar@localhost) by comp.chem.msu.su (8.13.3/8.13.3/Submit) id k0UJdcnU015465 for freebsd-net@freebsd.org; Mon, 30 Jan 2006 22:39:38 +0300 (MSK) (envelope-from yar) Date: Mon, 30 Jan 2006 22:39:38 +0300 From: Yar Tikhiy To: freebsd-net@freebsd.org Message-ID: <20060130193937.GG72743@comp.chem.msu.su> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.9i Subject: 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 19:39:53 -0000 Hi folks, Presently our vlan(4) driver sets interface's flags to 0 initially and copies a subset of them from the parent interface when the vlan interface is attached to its parent. In particular, copied are flags IFF_BROADCAST and IFF_MULTICAST. This approach has an unpleasant consequence: if you assign IP to vlan before attaching the latter to its parent, IP won't be properly set up on vlanX because the IP code does some special things for IFF_BROADCAST and IFF_MULTICAST interfaces; at least it sets up a broadcast address and joins the all-hosts group. I can see two ways to deal with the problem. The ideal and hard way is to provide hooks to notify upper network stack layers of changes in interface properties. However, I doubt if such feature is called for. The easy and practical way is to set IFF_BROADCAST and IFF_MULTICAST on vlan from the beginning and prohibit vlan from attaching to a non-bcast or non-mcast parent (which wouldn't work anyway.) Any comments? -- Yar