Commit Graph

1224 Commits

Author SHA1 Message Date
des
567ac2b268 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
des
125c5f9ff8 Don't use ovbcopy(); use void * instead of char *. 2003-04-04 12:11:46 +00:00
maxim
23ec3f074f 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
mdodd
cda1ad1e06 - 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
mdodd
1cbf7945de Assignment could be NULL, check. 2003-03-21 15:13:29 +00:00
jhb
b8b062b09b Use td->td_ucred instead of td->td_proc->p_ucred. 2003-03-20 21:17:40 +00:00
mdodd
41e5cea499 - 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
mdodd
5e42320b6c Fix whitespace issues. 2003-03-15 23:55:33 +00:00
mdodd
30a8fe52b5 Don't strip header from packets before input routine is called. 2003-03-15 23:08:40 +00:00
mdodd
08b4bf73c6 Use if_printf(). 2003-03-15 23:02:36 +00:00
mdodd
3f4c96a9a0 iso88025_ifattach() changes:
- Call if_attach().
- Conditionally call bpfattach() based on second function argument.
2003-03-15 22:52:23 +00:00
mdodd
5ad71fcdc1 - 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
mdodd
425161bc55 Stray } forgotten by manual merging. 2003-03-15 22:28:51 +00:00
mdodd
c1cc7fd6fc - Remove stray ).
- Add missing breaks.
- Add missing if_noproto++.
2003-03-15 22:25:06 +00:00
mdodd
e0526727e5 Revert part of 1.37; use bcopy() like if_fddisubr.c. 2003-03-15 22:09:29 +00:00
mdodd
41dd3f659d - 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
mdodd
d16675cd85 Update interface statistics after MAC and IFF_UP|IFF_RUNNING checks. 2003-03-15 21:51:39 +00:00
mdodd
b4d176598f - 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
mdodd
b9f3e4fdb7 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
mdodd
0e40955002 Use llc_control rather than llc_snap.control. 2003-03-15 20:35:19 +00:00
mdodd
7603a4a452 - Add comment.
- Whitespace fixes.
2003-03-15 20:33:30 +00:00
mdodd
af74801cd5 Reduce code differences. 2003-03-15 19:37:44 +00:00
mdodd
46d76d5c4c Use ISO88025_ADDR_LEN where appropriate. 2003-03-15 19:25:00 +00:00
mdodd
e0b9aba465 Don't use etherbroadcastaddr; use iso88025_broadcastaddr. 2003-03-15 19:16:39 +00:00
mdodd
093d40edb1 - Remove definition of senderr() from iso88025.h.
- Use definition of senderr() from if_ethersubr.c.
2003-03-15 19:10:19 +00:00
mdodd
ce9f489746 Some whitespace/style/readability changes. 2003-03-15 17:54:49 +00:00
mdodd
59ae65862f Add iso88025_resolvemulti().
Cribbed from net/if_fddisubr.c
2003-03-15 16:49:08 +00:00
mdodd
5093ecd00f Fix formatting of iso88025_ifattach(). 2003-03-15 16:41:35 +00:00
mdodd
f1887e0da7 Re-order and prune includes. 2003-03-15 16:37:28 +00:00
mdodd
9cb5290df7 Add module data and version. 2003-03-15 15:38:02 +00:00
mdodd
1c36442d83 s/llc_un.type_snap/llc_snap/g 2003-03-15 15:35:25 +00:00
mdodd
665939da8f Formatting and whitespace changes. 2003-03-15 15:09:11 +00:00
harti
928f52e38a 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
mux
9e54553707 Pass the correct malloc flags to m_tag_alloc(). 2003-03-13 00:30:31 +00:00
sam
e0702e06b4 correct two more flag misuses; m_tag* use malloc flags 2003-03-12 14:45:22 +00:00
phk
2fe1f6204d 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
jlemon
d41507bc4f 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
jlemon
95fa81544f 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
jlemon
3d6036b6f4 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
fbc7526e8f 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
jlemon
964a2116a0 GC unused files. 2003-03-04 23:28:19 +00:00
jlemon
04e28d5a81 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
phk
b67232b68c Make nokqfilter() return the correct return value.
Ditch the D_KQFILTER flag which was used to prevent calling NULL pointers.
2003-03-03 16:24:47 +00:00
phk
0ae911eb0e Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by:    re(scottl)
2003-03-03 12:15:54 +00:00
mdodd
3b02e497a0 Revert last commit. File tracks NetBSD.
Requested by:	 sam
2003-03-03 06:09:18 +00:00
mdodd
587970fdc3 sizeof(struct llc) -> LLC_SNAPFRAMELEN
sizeof(struct ether_header) -> ETHER_HDR_LEN
 sizeof(struct fddi_header) -> FDDI_HDR_LEN
2003-03-03 05:04:57 +00:00
mdodd
ae4db1f082 Use IFP2AC() rather than casting to struct arpcom * 2003-03-03 00:30:02 +00:00
mdodd
cd44ce8ede De-register. 2003-03-03 00:21:52 +00:00
mdodd
cd4fafb346 Reduce code duplication. This adds the function rt_check() to route.c.
Approved by:	 sam (in principle)
2003-03-02 21:34:37 +00:00
des
2756b6c964 More low-hanging fruit: kill caddr_t in calls to wakeup(9) / [mt]sleep(9). 2003-03-02 16:54:40 +00:00