Commit Graph

41 Commits

Author SHA1 Message Date
mycroft 7cd90d66b7 If the parent interface is not IFF_RUNNING, do not call its start function.
This prevent a variety of fun panics, and therefore fixes PR 12932, PR 17561,
and PR 18376...

XXX
...however this is most definitely a hack.  The real problem here is that there
is no callback to notify a "client" interface like vlan when a "parent"
interface's status changes, and therefore the vlan interface is always
IFF_RUNNING.  This allows packets to be queued on vlan interface at any time.
We can't simply leave the packets on the vlan interface, either, because there
is no callback to dequeue them.  And last, since it's always IFF_RUNNING, if
we just *toss* the packets, we lose gratuitous ARPs and DAD packets.

"This needs work," but at least it no longer bleeds.
2004-07-08 19:09:12 +00:00
simonb 9bc855a931 s/the the/the/ (only in sources that aren't regularly imported from
elsewhere).
2004-04-23 02:58:27 +00:00
itojun d2f1c029b9 kill sprintf, use snprintf 2004-04-21 18:40:37 +00:00
scw a9760a89e4 To cater for VLAN-aware layer 2 ethernet switches which may need to strip
the tag before forwarding the packet, make sure the packet+tag is at least
68 bytes long.

This is necessary because our parent will only pad to 64 bytes (ETHER_MIN_LEN)
and some switches will not pad by themselves after deleting a tag.
2003-12-05 19:35:43 +00:00
itojun 2cc4a6b1a7 need to use m_freem(), not m_free(). from iij seil team 2003-10-02 07:13:57 +00:00
drochner 1face2cc7a Fix vlan tag sending in the ETHERCAP_VLAN_HWTAGGING case.
Makes my "txp" work and fixes "bge" -- PR kern/20363 by Scott Ellis.
2003-09-09 14:22:19 +00:00
itojun 40606ab8f2 switch from kame-based m_aux mbuf auxiliary data, to openbsd m_tag
implementation.  it will simplify porting across *bsd (such as kame/altq),
and make us more synchronized.  from Joel Wilsson
2003-01-17 08:11:49 +00:00
pooka dc325578c7 fix a few typos in comments 2002-06-11 06:00:57 +00:00
lukem 34d65a3414 add RCSIDs 2001-11-12 23:49:33 +00:00
thorpej 42a2e688fe If the parent interface can do hardware-assisted VLAN encapsulation,
then propagate its hardware-assisted checksumming flags.
2001-06-12 06:16:59 +00:00
thorpej 5cbdcc502b Add ALTQ support (both for the VLAN interface itself, as well as for
being a VLAN on a ALTQ'ified interface).
2001-04-07 18:41:42 +00:00
thorpej 53c23f549a Start out with a link name that says "802.1Q VLAN", and inherit the
parent interface's as usual once we attach to the parent.  When we
detach from the parent, reset our link name to the "802.1Q VLAN" name.
2001-01-29 01:51:05 +00:00
itojun 32024e8a3d call if_alloc_sadl(). without it the following operation causes kernel panic:
# ifconfig vlan0 create
# ifconfig vlan0
2001-01-28 10:41:44 +00:00
thorpej a4ecde8c5e If no link level name is assigned, return EADDRNOTAVAIL on
SIOCGIFADDR.
2001-01-17 15:53:43 +00:00
thorpej f64af41401 No need to reference ifnet_addrs[]. 2001-01-16 21:18:56 +00:00
thorpej 23df92e38d Small cosmetic change. 2000-12-18 19:36:41 +00:00
thorpej 6484f81abc We now support hw vlan tag support in network interfaces, so remote it
from the TODO list.
2000-12-18 19:32:20 +00:00
bouyer 6e08061c2a Supports hardware 802.1q VLAN tagging, per discussion on tech-net. The tag is
stored in a m_aux mbuf defined by AF_LINK, ETHERTYPE_VLAN.
Thanks to Jason & Itojun for the feedback.
2000-11-17 19:21:53 +00:00
bouyer 0d0fd7718e Per discussion with Jason, change flags filter to
(IFF_UP | IFF_BROADCAST | IFF_RUNNING | IFF_ALLMULTI | IFF_SIMPLEX)
Also, put the ifp->if_opackets++ at the rigth place so that the counter is
incremented even when the parent is OACTIVE.
Fix a bug in vlan_input where the ethernet src and dst addrs would not be
correct because we only memmove() only ifv->ifv_encaplen instead of
sizeof(struct ether_header).
2000-11-15 18:15:11 +00:00
thorpej b84f740be0 Move bpfattach()/bpfdetach() calls into ether_ifattach()/ether_ifdetach(). 2000-11-15 01:02:11 +00:00
bouyer 3659b305e5 In vlan_config(), filter flags inherited from parent interface to
(IFF_UP | IFF_BROADCAST | IFF_RUNNING | IFF_ALLMULTI | IFF_SIMPLEX)
Without this, if the parent is OACTIVE of PROMISC at config time, we
loose.
2000-11-12 19:39:42 +00:00
enami d93a3cbc40 Don't return uninitialized value. 2000-11-10 02:31:53 +00:00
enami f52dd5bd61 Don't unlink and deallocate ether_multi here. ether_ifdetach will do it. 2000-11-10 02:29:44 +00:00
enami 17707b76db Define struct member correctly. This fixes a panic due to overwrite of stack. 2000-11-10 02:27:19 +00:00
thorpej c1e8f10429 Implement promiscuous mode. 2000-11-09 05:57:38 +00:00
bouyer 29fdeefaff Don't try to handle SIOCSIFADDR/SIOCADDMULTI/SIOCDELMULTI if a vlan/vlanif
hasn't been configured (prevent a panic in arp_ifinit when setting an
IP addr with no vlan/vlanif).
2000-10-15 11:58:26 +00:00
ad 04e67112d6 Remove defunct bpfdetach()/ether_ifdetach() calls. 2000-10-10 10:07:35 +00:00
enami b817ce40cb Cosmetic changes. 2000-10-04 06:51:12 +00:00
enami bc50cb2cae Remove redundant assignment. 2000-10-04 06:20:05 +00:00
thorpej 9f76a74e1e Pop one off the TODO list. 2000-10-03 23:52:39 +00:00
thorpej efbead5055 When an Ethernet interface detaches, unconfigure any VLANs associated
with it.
2000-10-03 23:50:52 +00:00
thorpej 96375e93ea Improve the VLAN support, in particular, handling of MTU:
- Add a macro to compute the max frame length based on Ethertype
  and presence of FCS, and use it to validate the packet size
  in ether_input().
- Add capabilites to struct ethercom, and allow hardware drivers
  to specify that they can handle the larger hardware MTU that
  VLANs require in order to strictly conform to 802.1Q.
- Make ether_ifdetach() clear out the link address and free all of
  the Ethernet multicast structures.

Also, rearrange the VLAN driver itself in preparation to supporting
other hardware types, including FDDI (which has 802.1Q VLAN capability).
2000-10-03 23:33:38 +00:00
ad 3a739b04a0 htons -> ntohs. From Alan Barrett <apb@cequrux.com>. 2000-10-02 14:41:26 +00:00
ad d74621ea64 Add an item to the TODO list. 2000-09-28 10:02:09 +00:00
enami a5028df36d Don't unconfigure if it is already unconfigured. 2000-09-28 08:28:56 +00:00
enami 177a258793 Fix think-o in previous; don't do the same test twice. 2000-09-28 07:35:36 +00:00
enami 8e1cd4f341 Port the multicast handling to NetBSD correctly. 2000-09-28 07:20:56 +00:00
enami dcf72a770a s/6/ETHER_ADDR_LEN/ 2000-09-28 07:01:41 +00:00
enami 63b56285cd Remove unnecessary test. 2000-09-28 07:00:53 +00:00
enami 2c4a718932 Remove unnecessary function decl. 2000-09-28 06:13:35 +00:00
thorpej 00746cb0d6 Support for 802.1Q Virtual LANs. Derived and cleaned up by
Andy Doran <ad@netbsd.org> from the FreeBSD/OpenBSD implementation.
A few minor changes to how it all hooks into the system by me.
2000-09-27 22:40:54 +00:00