Skip site navigation (1)Skip section navigation (2)
Date:      Sun,  5 Dec 1999 19:44:18 -0500 (EST)
From:      csg@waterspout.com
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        ajk@waterspout.com
Subject:   kern/15290: if_vlan fails to maintain IFF_RUNNING
Message-ID:  <19991206004418.2C8429E@dustdevil.waterspout.com>

next in thread | raw e-mail | index | archive | help

>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 <parent-device> up
 # ifconfig vlan0 vlandev <parent-device> vlan <vlan-tag>

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991206004418.2C8429E>