From owner-freebsd-bugs Sun Dec 5 16:50: 6 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 20B2414E60 for ; Sun, 5 Dec 1999 16:50:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id QAA49237; Sun, 5 Dec 1999 16:50:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from dustdevil.waterspout.com (dustdevil.waterspout.com [208.13.60.151]) by hub.freebsd.org (Postfix) with ESMTP id 04C4514E8A for ; Sun, 5 Dec 1999 16:41:49 -0800 (PST) (envelope-from csg@waterspout.com) Received: by dustdevil.waterspout.com (Postfix, from userid 1000) id 2C8429E; Sun, 5 Dec 1999 19:44:18 -0500 (EST) Message-Id: <19991206004418.2C8429E@dustdevil.waterspout.com> Date: Sun, 5 Dec 1999 19:44:18 -0500 (EST) From: csg@waterspout.com Reply-To: csg@waterspout.com To: FreeBSD-gnats-submit@freebsd.org Cc: ajk@waterspout.com X-Send-Pr-Version: 3.2 Subject: kern/15290: if_vlan fails to maintain IFF_RUNNING Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 15290 >Category: kern >Synopsis: vlan fails to maintain IFF_RUNNING >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Dec 5 16:50:00 PST 1999 >Closed-Date: >Last-Modified: >Originator: C. Stephen Gunn >Release: FreeBSD 3.3-STABLE i386 >Organization: WaterSpout Communications, Inc. >Environment: FreeBSD-3-STABLE and FreeBSD-CURRENT. >Description: sys/net/if_vlan.c fails to maintain the IFF_RUNNING flag on the vlan interfaces it manages. This prevents the interface from actually sending or receiving data. The handling of SIOCSETVLAN also incorrectly sets the device flags to zero, instead of clearing the IFF_RUNNING and IFF_UP flags. Just because the device isn't configured doesn't mean it still isn't IFF_MULTICAST (or its friends) any more. >How-To-Repeat: On FreeBSD 3-STABLE, or FreeBSD-CURRENT: 1. configure a vlan device/parent device # ifconfig up # ifconfig vlan0 vlandev vlan 2. ifconfig vlan0, notice that IFF_RUNNING isn't set, but the interface is not up. 3. watch most protocols not work since if_ethersubr.c checks for (IFF_UP|IFF_RUNNING), and returns ENETDOWN if they're not both set. >Fix: The following patch will maintain IFF_RUNNING when the vlan device is associated/disassociated with a parent ethernet device via the SIOCSETVLAN ioctl call: - BEGIN PATCH ----------------------------------------------------------------- Index: if_vlan.c =================================================================== RCS file: /usr/local/share/cvs/FreeBSD/src/sys/net/if_vlan.c,v retrieving revision 1.10 diff -u -r1.10 if_vlan.c --- if_vlan.c 1999/09/25 12:05:57 1.10 +++ if_vlan.c 1999/12/05 21:41:50 @@ -509,7 +509,7 @@ if (vlr.vlr_parent[0] == '\0') { vlan_unconfig(ifp); if_down(ifp); - ifp->if_flags = 0; + ifp->if_flags &= ~(IFF_UP|IFF_RUNNING); break; } p = ifunit(vlr.vlr_parent); @@ -521,6 +521,7 @@ if (error) break; ifv->ifv_tag = vlr.vlr_tag; + ifp->if_flags |= IFF_RUNNING; break; case SIOCGETVLAN: - END PATCH ------------------------------------------------------------------- >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message