Commit Graph

1329 Commits

Author SHA1 Message Date
Sam Leffler
b140bc1fc8 Correct pfil_run_hooks return handling: if the return value is non-zero
then the mbuf has been consumed by a hook; otherwise beware of a null
mbuf return (gack).  In particular the bridge was doing the wrong thing.
While in the ipv6 code make it's handling of pfil_run_hooks identical
to netbsd.

Pointed out by:	Pyun YongHyeon <yongari@kt-is.co.kr>
2003-09-30 04:46:08 +00:00
Poul-Henning Kamp
ed692400eb I don't know from where the notion that device driver should or
even could call VOP_REVOKE() on vnodes associated with its dev_t's
has originated, but it stops right here.

If there are things people belive destroy_dev() needs to learn how to
do, please tell me about it, preferably with a reproducible test case.

Include <sys/uio.h> in bluetooth code rather than rely on <sys/vnode.h>
to do so.

The fact that some of the USB code needs to include <sys/vnode.h>
still disturbs me greatly, but I do not have time to chase that.
2003-09-28 20:48:13 +00:00
Poul-Henning Kamp
2853ad7d60 Correctly name r_unit member tun_unit.
Remove unused tun_wsel member.
2003-09-27 21:43:16 +00:00
Sam Leffler
134ea22494 o update PFIL_HOOKS support to current API used by netbsd
o revamp IPv4+IPv6+bridge usage to match API changes
o remove pfil_head instances from protosw entries (no longer used)
o add locking
o bump FreeBSD version for 3rd party modules

Heavy lifting by:	"Max Laier" <max@love2party.net>
Supported by:		FreeBSD Foundation
Obtained from:		NetBSD (bits of pfil.h and pfil.c)
2003-09-23 17:54:04 +00:00
Peter Wemm
e31e949b5c While cleaning out my tree, fix another strict alias warning that would
be happening if we didn't stop compiling with -fno-strict-aliasing.
2003-09-22 23:24:18 +00:00
Sam Leffler
fd9469f628 fix build on 64-bit platforms 2003-09-17 18:14:49 +00:00
Sam Leffler
e636fe824a Minor overhaul and add locking.
o replace magic constants with #defines (e.g. ETHER_ADDR_LEN)
o move mib variables to net.link.ether.bridge with backwards compatible
  entries for well-known items maintained under BURN_BRIDGES
o revamp debugging support so it is conditioanlly compiled with BRIDGE_DEBUG
  (on currently) and runtime controlled by net.link.ether.bridge.debug
o change timeout to MPSAFE callout
o optimize lookup for common case of two interfaces
o optimize forwarding path to take IFNET lock only when needed
o make boot-time printf dependent on bootverbose
o sundry style changes (ANSI decls, extraneous spaces, etc.)

Sponsored by:	FreeBSD Foundation
2003-09-17 00:50:33 +00:00
Matthew N. Dodd
2049fdeefd Enable IPv6 for Token Ring. 2003-09-14 02:32:31 +00:00
Matthew N. Dodd
f8f1abafd2 Cosmetic cleanups. 2003-09-14 02:26:45 +00:00
Matthew N. Dodd
5dbc58b5ba Cosmetic adjustment. 2003-09-14 02:18:54 +00:00
Ruslan Ermilov
78f94aa951 Fix a bunch of off-by-one errors in the range checking code. 2003-09-11 21:40:21 +00:00
Sam Leffler
4faedfe87f Add locking. We use a single lock to guard the global vlan list and also
to protect the vlan state in each ifnet (e.g. vlan count).  The latter is
probably better handled through an ifnet-centric means but since changes
are infrequent shouldn't matter for now.

Sponsored by:	FreeBSD Foundation
2003-09-05 20:58:59 +00:00
Sam Leffler
e0111e4de5 Reduce window during which a race can occur when detaching
an interface from each descriptor that references it. This
is just a bandaid; the locking here needs to be redone.
2003-09-04 22:27:45 +00:00
Robert Watson
2166ffe8e1 Introduce error checking for calls to M_PREPEND():
ether_output() when prepending netatalk AFA_PHASE2 llc headers (TRYWAIT).
  ether_output() when prepending ethernet header to a frame (DONTWAIT).
2003-08-29 19:12:18 +00:00
Sam Leffler
c06eb4e293 Change instances of callout_init that specify MPSAFE behaviour to
use CALLOUT_MPSAFE instead of "1" for the second parameter.  This
does not change the behaviour; it just makes the intent more clear.
2003-08-19 17:51:11 +00:00
Sam Leffler
91a9d708ba add R_Zalloc definition that returns pre-zero'd memory 2003-08-19 17:23:07 +00:00
Sam Leffler
588523fae3 use ETHER_IS_MULTICAST instead of explicit check 2003-08-19 17:04:13 +00:00
Mike Silbersack
7ab9842a99 Also ifdef the variable which becomes unused w/o INET6, fixing the build
after the previous commit.

Noticed by:	alc
2003-08-09 05:44:00 +00:00
Mike Silbersack
fe3e8c5167 #ifdef INET6 the if_loop packet defrag; since only the ipv6 stack (might)
require this to be done, there's no reason to waste time doing it if
ipv6 isn't compiled in.

MFC after:	1 week
2003-08-09 02:55:11 +00:00
Hartmut Brandt
68ece75839 Remove the ATMIOCENA and ATMIOCDIS ioctl. Everyting has been converted
to use the new OPENVCC and CLOSEVCC calls that allow the sepcification
of traffic parameters for the connections.
2003-08-06 14:53:27 +00:00
Hartmut Brandt
a808105d63 Remove the last vestiges of ATM raw mode. This has not been useful for a
long time and has already been removed from the only driver that supported
it (en(4)) and from the man page.
2003-08-06 14:34:38 +00:00
Hartmut Brandt
6084351671 Define a flag for asynchronuous VC open/close operations as used
by the NATM stuff.
2003-08-05 13:48:01 +00:00
John-Mark Gurney
95aab9cc49 add support for using kqueue to watch bpf sockets.
Submitted by:	Brian Buchanan of nCircle, Inc.
Tested on:	i386 and sparc64
2003-08-05 07:12:49 +00:00
Hartmut Brandt
59db9a86db Implement a mechanism by which ATM drivers can inform interested
parts of the system about certain kinds of events, like changes
in the ABR rate, changes in the carrier state, PVC changes. The
main consumers of these events are the harp(4) pseudo-driver
and the ILMI daemon via ng_atm(4).
2003-07-29 13:04:52 +00:00
Gary Jennejohn
810bf55afe Use M_WAITOK instead of M_WAIT in sppp_attach(). 2003-07-26 21:58:06 +00:00
Sam Leffler
2bbe529d9c add monitor mode 2003-07-21 02:49:42 +00:00
Hajimu UMEMOTO
89eaef50bb Disabling multicast on vlan interface caused kernel panic.
PR:		kern/40723
Submitted by:	Hideki ONO <ono@kame.net>
MFC after:	1 week
2003-07-19 16:47:16 +00:00
Jeffrey Hsu
1ebe998675 Add mutex for routing entries.
Reviewed by:	bmilekic, silby
2003-07-19 00:21:13 +00:00
Hartmut Brandt
e805a9b9f9 Correct the device identifiers for the ProATM cards. 2003-07-18 08:40:45 +00:00
Hartmut Brandt
09d405d969 Implement an utility function that can be used by device drivers to
implement the ATMIOCGVCCS ioctls. This routine handles changing
VCC tables (which can occure because we cannot hold the driver mutex
while allocating memory) with a loop and a re-allocation, should the
table not fit in the allocated memory.
2003-07-15 10:37:09 +00:00
Hartmut Brandt
198b0c39a9 The mbuf put on the interface queue contains the 4-byte pseudoheader.
Account for this in the byte count.
2003-07-15 10:30:57 +00:00
Hartmut Brandt
21a023e9c8 Add identifiers for ProSum's and IDT's cards that are based on
the IDT77252 chip. The driver will follow soon.
2003-07-15 10:28:06 +00:00
Hartmut Brandt
918c6c0c7e ATM_PH_LLCSNAP and ATMIO_FLAG_LLCSNAP must have the same value, so
define one in terms of the other.
2003-07-15 10:26:34 +00:00
Hartmut Brandt
e6b34a1dbb Protect a kernel structure by _KERNEL. 2003-07-15 10:22:55 +00:00
Robert Watson
533d8562e4 Move the MAC entry point to label ethernet-sourced mbufs with a MAC label
from the network interface earlier in ether_input().  At some point
(no fingers pointed), things were restructured and the labeling operation
moved later.  This wasn't a problem as BPF_MTAP() relies on the ifnet
label not the mbuf label, but there might have been other problems.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-07-13 20:32:58 +00:00
Bill Paul
fb88a3e0f4 - In vlan_input(), always mask off all but the VLID bits from tags
extracted from received frames, both in the IFCAP_VLAN_HWTAGGING case
  and not. (Some drivers may already do this masking internally, but
  doing it here doesn't hurt and insures consistency.)

- In vlan_ioctl(), don't let the user set a VLAN ID value with anything
  besides the VLID bits set, otherwise we will have trouble matching
  an interface in vlan_input() later.

PR:		kern/46405
2003-07-08 21:54:20 +00:00
Bill Paul
79a5874541 Testing VLANs with the new 8139C+ chip (which does hardware tag
insertion and extraction) has revealed two bugs:

- In vlan_start(), we're supposed to check the underlying interface to
  see if it has the IFCAP_VLAN_HWTAGGING cabability set and, if so, set
  things up for the VLAN_OUTPUT_TAG() routine. However the code checks
  ifp->if_capabilities, which is the vlan pseudo-interface's capabilities
  when it should be checking p->if_capabilities, which relates to the
  underlying physical interface. Change ifp->if_capabilities to
  p->if_capabilities so this works.

- In vlan_input(), we have to extract the 16-bit tag value from the
  received frame and use it to figure out which vlan interface gets
  the frame. The code that we use to track down the desired vlan
  pseudo-interface is:

       for (ifv = LIST_FIRST(&ifv_list); ifv != NULL;
            ifv = LIST_NEXT(ifv, ifv_list))
                if (ifp == ifv->ifv_p && tag == ifv->ifv_tag)
                        break;

  The problem is that 'tag' is not computed consistently. In the case
  where the interface supports hardware VLAN tag extraction and calls
  VLAN_INPUT_TAG(), we do this:

                tag = *(u_int*)(mtag+1);

  But in the software emulation case, we do this

                tag = EVL_VLANOFTAG(ntohs(evl->evl_tag));

  The problem here is the EVL_VLANOFTAG() macro is only ever applied
  in this one case. It's never applied to ifv->ifv_tag or anwhere else.
  We must be consistent: either it's applied everywhere or nowhere.
  To see how this can be a problem, do something like
  ifconfig vlan0 vlan 12345 vlandev foo0 and observe the results.

  I'm not quite sure what the right thing is to do here. Neither the
  vlan(4) nor ifconfig(8) man pages suggest which way to go. For now,
  I've removed this use of EVL_VLANOFTAG() so that the tag will match
  correctly in all cases. I will not get upset if somebody makes a
  compelling argument for using EVL_VLANOFTAG() everywhere instead,
  as long as the use is consistent.
2003-07-06 03:24:25 +00:00
Sam Leffler
77882f20ef remove old 802.11 support; replaced by new code in sys/net80211 2003-06-28 06:09:39 +00:00
Sam Leffler
2dd59091ae add "autoselect" mode and "auto" alias: these let you reset the
"phy mode" to an auto-selecting mode, as opposed to one where
you're locked to a particular one (e.g. 11a for 802.11)
2003-06-25 15:03:05 +00:00
Hartmut Brandt
9bdca35df1 Add the hooks for netgraph and HARP to the NATM code. This allows us
to use one set of drivers for all ATM upper layers.
2003-06-23 16:53:28 +00:00
Hartmut Brandt
76335e1302 Apply style(9) to this file. I'm going to touch large parts of this file
so make this beforehand.
2003-06-23 10:32:13 +00:00
Hartmut Brandt
92fe9ad65b Now that most of this file is new, stylify the rest and correct the
style bugs (space/tab) introduced by me.
2003-06-18 10:53:49 +00:00
Hartmut Brandt
19050bee21 Add definitions for the ioctls that are used by netgraph and harp to open
and close VCCs.
2003-06-17 11:51:30 +00:00
Hartmut Brandt
7d361237dc Fix the breakage introduced by rev. 1.43 of sys/dev/midway.c (don't commit
on friday 13th and without making a universe). This adds struct and
constant definitions for ATM traffic parameters and re-enables the
build of the midway driver.

Tested by: make universe
2003-06-16 13:52:27 +00:00
Hartmut Brandt
d68d53d4d6 Fix a typo in an ATM media name. As this name was not use yet, no problems
should occur.
2003-06-02 09:13:08 +00:00
Poul-Henning Kamp
21b16e9715 Wrap macro in do {...} while(0);
Found by:       FlexeLint
2003-05-31 20:07:16 +00:00
Poul-Henning Kamp
048069758e Remove break after return.
Found by:       FlexeLint
2003-05-31 20:06:27 +00:00
Mike Silbersack
17d6531977 Replace a handrolled defrag function with m_defrag. The handrolled
function couldn't handle chains of > MCLBYTES, and it had a bug which
caused corruption and panics in certain low mbuf situations.

Additionally, change the failure case so that looutput returns ENOBUFS
rather than attempting to pass on non-defragmented mbuf chains.

Finally, remove the printf which would happen every time the low memory
situation occured.  It served no useful purpose other than to clue me
in as to what was causing the panic in question. :)

MFC after:	4 days
2003-05-28 02:04:33 +00:00
Hartmut Brandt
2102bdf21a Define a link layer MIB for ATM. Most fields of this MIB are needed by
ILMI daemons. Factor out common softc fields for all ATM interfaces that
need to be externally visible into an ifatm structure and make the midway
driver using this structure and fill the MIB.
2003-05-05 16:35:52 +00:00
David E. O'Brien
824eb9dc1b Back out rev 1.146 -- it broke the LINT build.
We are about to enter the 5.1 code freeze and things must be buildable.
2003-05-05 09:15:50 +00:00
Mark Murray
51da11a27a Fix some easy, global, lint warnings. In most cases, this means
making some local variables static. In a couple of cases, this means
removing an unused variable.
2003-04-30 12:57:40 +00:00
Hartmut Brandt
2b75e097f1 Add media types and options for ATM. While on most ATM cards media cannot
be changed, it is very convenient to be able to toggle SDH/Sonet,
idle/unassigned cells and scrambled mode and to see the carrier
state.

Reviewed by:	-arch (if_media.h definitions)
2003-04-29 17:23:23 +00:00
Hartmut Brandt
d2c96fc51f Add module data and version to the atm_subr and reference this info from the
(currently) only consumer (en).

Add a sysctl node hw.atm where the atm drivers will hook on their hardware
sysctl sub-trees.

Make atm_ifattach call if_attach and remove the corresponding call to if_attach
from en. Create atm_ifdetach and use that in en.

While the last change actually changes the interface this is not a problem in
practice because the only other consumer of this API is an older LANAI driver
on the net, that is not ready for current anyway.

Reviewed by:	-atm
2003-04-29 08:07:44 +00:00
Sam Leffler
1311709a57 o add support for multi-mode devices like 802.11 wireless cards that support
11a/b/g by adding an optional 3-bit mode field
o correct the spelling of OFDM (was ODFM)
o add an 802.11 subtype option for turbo mode: the phy is clocked at 2x the
  normal clock rate; note this can be applied to both OFDM in 11a and OFDM
  in 11g mode (and possibly DS11 in 11b for certain phy's)
o add 802.11 CCK aliases for 11b/11g rates--the more common terminology
2003-04-28 16:35:51 +00:00
Archie Cobbs
c1404dc060 Tweak to previous commit: increment ifp->if_iqdrops if the m_copy() fails.
Suggested by:	Neelkanth Natu <neelnatu@yahoo.com>
2003-04-23 23:45:57 +00:00
Archie Cobbs
79db6ff316 Fix a case where the return value from m_copy() was not being checked
for NULL before proceeding, causing a crash if mbufs were exhausted.

MFC after:	3 days
Reported by:	Mark Gooderum <mark@verniernetworks.com>
2003-04-23 18:35:40 +00:00
Robert Watson
225bff6f8b Move MAC label storage for mbufs into m_tags from the m_pkthdr structure,
returning some additional room in the first mbuf in a chain, and
avoiding feature-specific contents in the mbuf header.  To do this:

- Modify mbuf_to_label() to extract the tag, returning NULL if not
  found.

- Introduce mac_init_mbuf_tag() which does most of the work
  mac_init_mbuf() used to do, except on an m_tag rather than an
  mbuf.

- Scale back mac_init_mbuf() to perform m_tag allocation and invoke
  mac_init_mbuf_tag().

- Replace mac_destroy_mbuf() with mac_destroy_mbuf_tag(), since
  m_tag's are now GC'd deep in the m_tag/mbuf code rather than
  at a higher level when mbufs are directly free()'d.

- Add mac_copy_mbuf_tag() to support m_copy_pkthdr() and related
  notions.

- Generally change all references to mbuf labels so that they use
  mbuf_to_label() rather than &mbuf->m_pkthdr.label.  This
  required no changes in the MAC policies (yay!).

- Tweak mbuf release routines to not call mac_destroy_mbuf(),
  tag destruction takes care of it for us now.

- Remove MAC magic from m_copy_pkthdr() and m_move_pkthdr() --
  the existing m_tag support does all this for us.  Note that
  we can no longer just zero the m_tag list on the target mbuf,
  rather, we have to delete the chain because m_tag's will
  already be hung off freshly allocated mbuf's.

- Tweak m_tag copying routines so that if we're copying a MAC
  m_tag, we don't do a binary copy, rather, we initialize the
  new storage and do a deep copy of the label.

- Remove use of MAC_FLAG_INITIALIZED in a few bizarre places
  having to do with mbuf header copies previously.

- When an mbuf is copied in ip_input(), we no longer need to
  explicitly copy the label because it will get handled by the
  m_tag code now.

- No longer any weird handling of MAC labels in if_loop.c during
  header copies.

- Add MPC_LOADTIME_FLAG_LABELMBUFS flag to Biba, MLS, mac_test.
  In mac_test, handle the label==NULL case, since it can be
  dynamically loaded.

In order to improve performance with this change, introduce the notion
of "lazy MAC label allocation" -- only allocate m_tag storage for MAC
labels if we're running with a policy that uses MAC labels on mbufs.
Policies declare this intent by setting the MPC_LOADTIME_FLAG_LABELMBUFS
flag in their load-time flags field during declaration.  Note: this
opens up the possibility of post-boot policy modules getting back NULL
slot entries even though they have policy invariants of non-NULL slot
entries, as the policy might have been loaded after the mbuf was
allocated, leaving the mbuf without label storage.  Policies that cannot
handle this case must be declared as NOTLATE, or must be modified.

- mac_labelmbufs holds the current cumulative status as to whether
  any policies require mbuf labeling or not.  This is updated whenever
  the active policy set changes by the function mac_policy_updateflags().
  The function iterates the list and checks whether any have the
  flag set.  Write access to this variable is protected by the policy
  list; read access is currently not protected for performance reasons.
  This might change if it causes problems.

- Add MAC_POLICY_LIST_ASSERT_EXCLUSIVE() to permit the flags update
  function to assert appropriate locks.

- This makes allocation in mac_init_mbuf() conditional on the flag.

Reviewed by:	sam
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-04-14 20:39:06 +00:00
Jeffrey Hsu
983985c11e No need to unlock if error detected before locking.
Submitted by:	harti
2003-04-13 06:21:02 +00:00
Dag-Erling Smørgrav
fe58453891 Introduce an M_ASSERTPKTHDR() macro which performs the very common task
of asserting that an mbuf has a packet header.  Use it instead of hand-
rolled versions wherever applicable.

Submitted by:	Hiten Pandya <hiten@unixdaemons.com>
2003-04-08 14:25:47 +00:00
Dag-Erling Smørgrav
7283c97574 Don't use ovbcopy(); use void * instead of char *. 2003-04-04 12:11:46 +00:00
Maxim Konovalov
7102717ac1 o netisr_queue() returns 1 on success and 0 on failure,
fix a typo (?) in rev. 1.90.

PR:		kern/50163
2003-03-27 12:52:57 +00:00
Matthew N. Dodd
868d8b6286 - Use if_broadcastaddr from struct ifnet rather than relying on
extern 'etherbroadcastaddr'.
- Make 'etherbroadcastaddr' static.

Reviewed by:	 imp
2003-03-21 17:53:16 +00:00
Matthew N. Dodd
d79bf33783 Assignment could be NULL, check. 2003-03-21 15:13:29 +00:00
John Baldwin
31566c96f4 Use td->td_ucred instead of td->td_proc->p_ucred. 2003-03-20 21:17:40 +00:00
Matthew N. Dodd
04b269f5fe - Use IFP2AC().
- Support IFF_MONITOR.
- Borrow some consistency for if_input() routines from if_ethersubr.c.
- Correct comments regarding fddi_input() that no longer apply.
2003-03-16 00:17:44 +00:00
Matthew N. Dodd
8b247b5adc Fix whitespace issues. 2003-03-15 23:55:33 +00:00
Matthew N. Dodd
ac46f4fce3 Don't strip header from packets before input routine is called. 2003-03-15 23:08:40 +00:00
Matthew N. Dodd
59d776b808 Use if_printf(). 2003-03-15 23:02:36 +00:00
Matthew N. Dodd
089b2f2ead iso88025_ifattach() changes:
- Call if_attach().
- Conditionally call bpfattach() based on second function argument.
2003-03-15 22:52:23 +00:00
Matthew N. Dodd
69ed274634 - Style(9) changes.
- Remove unneeded assignment.
- Increment if_oerrors as per if_fddisubr.c.
- Wrap ISO code with conditional.
2003-03-15 22:37:11 +00:00
Matthew N. Dodd
94b3e4d32f Stray } forgotten by manual merging. 2003-03-15 22:28:51 +00:00
Matthew N. Dodd
bd3e6bb8b8 - Remove stray ).
- Add missing breaks.
- Add missing if_noproto++.
2003-03-15 22:25:06 +00:00
Matthew N. Dodd
0e96758da8 Revert part of 1.37; use bcopy() like if_fddisubr.c. 2003-03-15 22:09:29 +00:00
Matthew N. Dodd
2910fe6d37 - Increment ifp->if_noproto when appropriate.
- Use 'goto dropanyway' when appropriate.
- Move dropanyway label out of switch for readability.
2003-03-15 21:59:11 +00:00
Matthew N. Dodd
0c61d694a8 Update interface statistics after MAC and IFF_UP|IFF_RUNNING checks. 2003-03-15 21:51:39 +00:00
Matthew N. Dodd
f156dd7b68 - Adopt tests for (IFF_UP|IFF_RUNNING) and non local unicast packets
in promiscuous mode from if_fddisubr.c.
- Add comment to reduce diffs.
2003-03-15 21:42:19 +00:00
Matthew N. Dodd
9a3c9f3971 Add MAC support.
This is the same code that was added in 1.70 of if_fddisubr.c
2003-03-15 21:30:00 +00:00
Matthew N. Dodd
15eccea260 Use llc_control rather than llc_snap.control. 2003-03-15 20:35:19 +00:00
Matthew N. Dodd
ad20d0f577 - Add comment.
- Whitespace fixes.
2003-03-15 20:33:30 +00:00
Matthew N. Dodd
06f684b004 Reduce code differences. 2003-03-15 19:37:44 +00:00
Matthew N. Dodd
a93a116153 Use ISO88025_ADDR_LEN where appropriate. 2003-03-15 19:25:00 +00:00
Matthew N. Dodd
dbd05f2e56 Don't use etherbroadcastaddr; use iso88025_broadcastaddr. 2003-03-15 19:16:39 +00:00
Matthew N. Dodd
fd87fbf6b8 - Remove definition of senderr() from iso88025.h.
- Use definition of senderr() from if_ethersubr.c.
2003-03-15 19:10:19 +00:00
Matthew N. Dodd
386dca02cb Some whitespace/style/readability changes. 2003-03-15 17:54:49 +00:00
Matthew N. Dodd
7c16bd3a8b Add iso88025_resolvemulti().
Cribbed from net/if_fddisubr.c
2003-03-15 16:49:08 +00:00
Matthew N. Dodd
bf54cb290a Fix formatting of iso88025_ifattach(). 2003-03-15 16:41:35 +00:00
Matthew N. Dodd
fe7e109c6f Re-order and prune includes. 2003-03-15 16:37:28 +00:00
Matthew N. Dodd
40811c1473 Add module data and version. 2003-03-15 15:38:02 +00:00
Matthew N. Dodd
4fd80d5b9d s/llc_un.type_snap/llc_snap/g 2003-03-15 15:35:25 +00:00
Matthew N. Dodd
67df65de97 Formatting and whitespace changes. 2003-03-15 15:09:11 +00:00
Hartmut Brandt
57648f8aae This corrects a longstanding endian bug in processing LLC/SNAP encoded
frames. A comment in if_atm.h suggests that both macros, that for extracting
the ethertype and that for inserting it, handle their argument in host
byte order. In fact, the inserting macro treated its argument as an opposite
host order short and the calling code feeds it the result of htons(). This
happens to work on i386, but fails on sparc. Make the macro use real host
endianess.

Reviewed by:	kjc, atm@
2003-03-13 12:44:06 +00:00
Maxime Henrion
f3b8b63b15 Pass the correct malloc flags to m_tag_alloc(). 2003-03-13 00:30:31 +00:00
Sam Leffler
4a692a1fc2 correct two more flag misuses; m_tag* use malloc flags 2003-03-12 14:45:22 +00:00
Poul-Henning Kamp
d42ee4e410 Note that MAJOR_AUTO is now the default if d_maj is not initialized. This
is more robust and prevents the hijacking of /dev/console for the typical
mistake.

Remove unneeded MAJOR_AUTO uses, it is only needed explicitly now if the
driver source has cross-branch compatibility to old releases.
2003-03-09 11:03:45 +00:00
Jonathan Lemon
fb68148f4a Discard the packet if the netisr queue is null instead of panicing, for
the benefit of modules which are compiled differently than the kernel.
2003-03-08 22:12:32 +00:00
Jonathan Lemon
06acad4aa4 Revert last change and insure the driver can support other address families.
Pointed out by: ume, matusita
2003-03-08 17:32:21 +00:00
Jonathan Lemon
e0e6419344 The tun driver is INET only. Don't pretend to support other address families.
Sponsored by: DARPA, NAI Labs
2003-03-08 16:26:34 +00:00
Peter Wemm
3c6b084e96 Finish driving a stake through the heart of netns and the associated
ifdefs scattered around the place - its dead Jim!

The SMB stuff had stolen AF_NS, make it official.
2003-03-05 19:24:24 +00:00
Jonathan Lemon
f0757123c9 GC unused files. 2003-03-04 23:28:19 +00:00
Jonathan Lemon
1cafed3941 Update netisr handling; Each SWI now registers its queue, and all queue
drain routines are done by swi_net, which allows for better queue control
at some future point.  Packets may also be directly dispatched to a netisr
instead of queued, this may be of interest at some installations, but
currently defaults to off.

Reviewed by: hsu, silby, jayanth, sam
Sponsored by: DARPA, NAI Labs
2003-03-04 23:19:55 +00:00