diff options
author | yar <yar@FreeBSD.org> | 2004-07-26 14:46:04 +0000 |
---|---|---|
committer | yar <yar@FreeBSD.org> | 2004-07-26 14:46:04 +0000 |
commit | a63ad31e7f8f6b7913f402d253119edd7682c06d (patch) | |
tree | 751586e068e6694f8659a5c0d2ca1ced0e17c011 /sys/net/if_vlan.c | |
parent | 78326c15fe417280aa5aa8548e2864bd64075f52 (diff) | |
download | FreeBSD-src-a63ad31e7f8f6b7913f402d253119edd7682c06d.zip FreeBSD-src-a63ad31e7f8f6b7913f402d253119edd7682c06d.tar.gz |
Stop tinkering with the parent's VLAN_MTU capability.
Now it is user-controlled through ifconfig(8).
The former ``automagic'' way of operation created more
trouble than good. First, VLAN_MTU consumers other than
vlan(4) had appeared, e.g., ng_vlan(4). Second, there was
no way to disable VLAN_MTU manually if it were causing
trouble, e.g., data corruption.
Dropping the ``automagic'' should be completely invisible
to the user since
a) all the drivers supporting VLAN_MTU
have it enabled by default, and in the first place
b) there is only one driver that can really toggle VLAN_MTU
in the hardware under its control (it's fxp(4), to which
I added VLAN_MTU controls to illustrate the principle.)
Diffstat (limited to 'sys/net/if_vlan.c')
-rw-r--r-- | sys/net/if_vlan.c | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 55eb541..d18f056 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -651,26 +651,17 @@ vlan_config(struct ifvlan *ifv, struct ifnet *p) ifv->ifv_flags = 0; /* + * The active VLAN counter on the parent is used + * at various places to see if there is a vlan(4) + * attached to this physical interface. + */ + p->if_nvlans++; + + /* * If the parent supports the VLAN_MTU capability, * i.e. can Tx/Rx larger than ETHER_MAX_LEN frames, * use it. - * First of all, enable Tx/Rx of such extended frames on the - * parent if it's disabled and we're the first to attach. */ - p->if_nvlans++; - if (p->if_nvlans == 1 && - (p->if_capabilities & IFCAP_VLAN_MTU) && - (p->if_capenable & IFCAP_VLAN_MTU) == 0) { - struct ifreq ifr; - int error; - - ifr.ifr_reqcap = p->if_capenable | IFCAP_VLAN_MTU; - error = (*p->if_ioctl)(p, SIOCSIFCAP, (caddr_t) &ifr); - if (error) { - p->if_nvlans--; - return (error); - } - } if (p->if_capenable & IFCAP_VLAN_MTU) { /* * No need to fudge the MTU since the parent can @@ -777,17 +768,6 @@ vlan_unconfig(struct ifnet *ifp) } p->if_nvlans--; - if (p->if_nvlans == 0) { - struct ifreq ifr; - - /* - * Try to disable Tx/Rx of VLAN-sized frames. - * This may have no effect for some interfaces, - * but only the parent driver knows that. - */ - ifr.ifr_reqcap = p->if_capenable & ~IFCAP_VLAN_MTU; - (*p->if_ioctl)(p, SIOCSIFCAP, (caddr_t) &ifr); - } } /* Disconnect from parent. */ |