diff options
| author | Yaroslav Tykhiy <ytykhiy@gmail.com> | 2006-01-31 16:41:05 +0000 |
|---|---|---|
| committer | Yaroslav Tykhiy <ytykhiy@gmail.com> | 2006-01-31 16:41:05 +0000 |
| commit | 64a17d2e869a58367ed93aaa5d216f3e684b88dd (patch) | |
| tree | 0b70755ee51573d0e1bbdc8147d64ff93de37c50 | |
| parent | 4ca64f1db659023d1e59f8098631ca0734919349 (diff) | |
Notes
| -rw-r--r-- | sys/net/if_vlan.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 4ef86baabdc8..de7c2df4576c 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -73,6 +73,7 @@ #define VLANNAME "vlan" #define VLAN_DEF_HWIDTH 4 +#define VLAN_IFFLAGS (IFF_BROADCAST | IFF_MULTICAST) LIST_HEAD(ifvlanhead, ifvlan); @@ -628,6 +629,7 @@ vlan_clone_create(struct if_clone *ifc, char *name, size_t len) ifp->if_start = vlan_start; ifp->if_ioctl = vlan_ioctl; ifp->if_snd.ifq_maxlen = ifqmaxlen; + ifp->if_flags = VLAN_IFFLAGS; ether_ifattach(ifp, eaddr); /* Now undo some of the damage... */ ifp->if_baudrate = 0; @@ -903,6 +905,8 @@ vlan_config(struct ifvlan *ifv, struct ifnet *p, uint16_t tag) return (EINVAL); if (p->if_type != IFT_ETHER) return (EPROTONOSUPPORT); + if ((p->if_flags & VLAN_IFFLAGS) != VLAN_IFFLAGS) + return (EPROTONOSUPPORT); if (ifv->ifv_trunk) return (EBUSY); @@ -974,8 +978,7 @@ exists: * Copy only a selected subset of flags from the parent. * Other flags are none of our business. */ -#define VLAN_COPY_FLAGS \ - (IFF_BROADCAST | IFF_MULTICAST | IFF_SIMPLEX | IFF_POINTOPOINT) +#define VLAN_COPY_FLAGS (IFF_SIMPLEX) ifp->if_flags &= ~VLAN_COPY_FLAGS; ifp->if_flags |= p->if_flags & VLAN_COPY_FLAGS; #undef VLAN_COPY_FLAGS |
