Commit Graph

66 Commits

Author SHA1 Message Date
imp
3618e2b1b6 /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
mlaier
7d2928fa38 Replace IF_HANDOFF with new IFQ_HANDOFF to enqueue with ALTQ once enabled on
the respective drivers.
2004-06-15 23:57:42 +00:00
luigi
bf798d9da0 This commit does two things:
1. rt_check() cleanup:
    rt_check() is only necessary for some address families to gain access
    to the corresponding arp entry, so call it only in/near the *resolve()
    routines where it is actually used -- at the moment this is
    arpresolve(), nd6_storelladdr() (the call is embedded here),
    and atmresolve() (the call is just before atmresolve to reduce
    the number of changes).
    This change will make it a lot easier to decouple the arp table
    from the routing table.

    There is an extra call to rt_check() in if_iso88025subr.c to
    determine the routing info length. I have left it alone for
    the time being.

    The interface of arpresolve() and nd6_storelladdr() now changes slightly:
     + the 'rtentry' parameter (really a hint from the upper level layer)
       is now passed unchanged from *_output(), so it becomes the route
       to the final destination and not to the gateway.
     + the routines will return 0 if resolution is possible, non-zero
       otherwise.
     + arpresolve() returns EWOULDBLOCK in case the mbuf is being held
       waiting for an arp reply -- in this case the error code is masked
       in the caller so the upper layer protocol will not see a failure.

2. arpcom untangling
    Where possible, use 'struct ifnet' instead of 'struct arpcom' variables,
    and use the IFP2AC macro to access arpcom fields.
    This mostly affects the netatalk code.

=== Detailed changes: ===
net/if_arcsubr.c
   rt_check() cleanup, remove a useless variable

net/if_atmsubr.c
   rt_check() cleanup

net/if_ethersubr.c
   rt_check() cleanup, arpcom untangling

net/if_fddisubr.c
   rt_check() cleanup, arpcom untangling

net/if_iso88025subr.c
   rt_check() cleanup

netatalk/aarp.c
   arpcom untangling, remove a block of duplicated code

netatalk/at_extern.h
   arpcom untangling

netinet/if_ether.c
   rt_check() cleanup (change arpresolve)

netinet6/nd6.c
   rt_check() cleanup (change nd6_storelladdr)
2004-04-25 09:24:52 +00:00
luigi
bc64d173e0 arpcom untangling:
- use ifp instead if &ac->ac_if in a couple of nd6* calls;
   this removes a useless dependency.

 - use IFP2AC(ifp) instead of an extra variable to point to the struct arpcom;
   this does not remove the nesting dependency between arpcom and ifnet but
   makes it more evident.
2004-04-24 21:59:41 +00:00
luigi
6a1ce97384 + rename and document an unused field in struct arpcom (field is still
there so there are no ABI changes);
+ replace 5 redefinitions of the IPF2AC macro with one in if_arp.h

Eventually (but before freezing the ABI) we need to get rid of
struct arpcom (initially with the help of some smart #defines
to avoid having to touch each and every driver, see below).

Apart from the struct ifnet, struct arpcom now only stores a copy
of the MAC address (ac_enaddr, but we already have another copy in
the struct ifnet -- if_addrhead), and a netgraph-specific field
which is _always_ accessed through the ifp, so it might well go
into the struct ifnet too (where, besides, there is already an entry
for AF_NETGRAPH data...)

Too bad ac_enaddr is widely referenced by all drivers. But
this can be fixed as follows:

#define ac_enaddr       ac_if.the_original_ac_enaddr_in_struct_ifnet

(note that the right hand side would likely be a pointer rather than
the base address of an array.)
2004-04-18 01:15:32 +00:00
luigi
dd9a4fa714 whoops, forgot to fix these places where arpresolve() was used
Detected by: tinderbox
2004-04-04 11:52:09 +00:00
mdodd
004c6a3f30 Handle AF_ARP in *_output()
Obtained from:	NetBSD
2004-03-14 05:24:54 +00:00
rwatson
11f23ebb21 Constify iso88025_broadcastaddr to make it clear no explicit
synchronization is required.
2004-03-13 05:46:26 +00:00
andre
e2617352f3 Introduce ip_fastforward and remove ip_flow.
Short description of ip_fastforward:

 o adds full direct process-to-completion IPv4 forwarding code
 o handles ip fragmentation incl. hw support (ip_flow did not)
 o sends icmp needfrag to source if DF is set (ip_flow did not)
 o supports ipfw and ipfilter (ip_flow did not)
 o supports divert, ipfw fwd and ipfilter nat (ip_flow did not)
 o returns anything it can't handle back to normal ip_input

Enable with sysctl -w net.inet.ip.fastforwarding=1

Reviewed by:	sam (mentor)
2003-11-14 21:02:22 +00:00
mdodd
132fee551e Enable IPv6 for Token Ring. 2003-09-14 02:32:31 +00:00
mdodd
d35573967e Cosmetic cleanups. 2003-09-14 02:26:45 +00:00
mdodd
d25d60a02f Cosmetic adjustment. 2003-09-14 02:18:54 +00:00
mdodd
0bc153f9c5 - 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
f28fab8bf3 Don't strip header from packets before input routine is called. 2003-03-15 23:08:40 +00:00
mdodd
9457d96b7c Use if_printf(). 2003-03-15 23:02:36 +00:00
mdodd
b49399143f iso88025_ifattach() changes:
- Call if_attach().
- Conditionally call bpfattach() based on second function argument.
2003-03-15 22:52:23 +00:00
mdodd
489a90424e - 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
24c357e347 Stray } forgotten by manual merging. 2003-03-15 22:28:51 +00:00
mdodd
b43e84b215 - Remove stray ).
- Add missing breaks.
- Add missing if_noproto++.
2003-03-15 22:25:06 +00:00
mdodd
564965b944 Revert part of 1.37; use bcopy() like if_fddisubr.c. 2003-03-15 22:09:29 +00:00
mdodd
797615a094 - 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
f0bf90e91d - 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
390688382a 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
ed231d20e5 Use llc_control rather than llc_snap.control. 2003-03-15 20:35:19 +00:00
mdodd
3a12ab5342 - Add comment.
- Whitespace fixes.
2003-03-15 20:33:30 +00:00
mdodd
c339938a35 Reduce code differences. 2003-03-15 19:37:44 +00:00
mdodd
cf21a82a02 Use ISO88025_ADDR_LEN where appropriate. 2003-03-15 19:25:00 +00:00
mdodd
64c5df2c6b Don't use etherbroadcastaddr; use iso88025_broadcastaddr. 2003-03-15 19:16:39 +00:00
mdodd
ec0d0b87d8 - Remove definition of senderr() from iso88025.h.
- Use definition of senderr() from if_ethersubr.c.
2003-03-15 19:10:19 +00:00
mdodd
a82bd5bb3d Some whitespace/style/readability changes. 2003-03-15 17:54:49 +00:00
mdodd
4e2727ed85 Add iso88025_resolvemulti().
Cribbed from net/if_fddisubr.c
2003-03-15 16:49:08 +00:00
mdodd
9d6ba2c0d8 Fix formatting of iso88025_ifattach(). 2003-03-15 16:41:35 +00:00
mdodd
76cf715401 Re-order and prune includes. 2003-03-15 16:37:28 +00:00
mdodd
5eadb25e88 Add module data and version. 2003-03-15 15:38:02 +00:00
mdodd
ae74f2cf81 s/llc_un.type_snap/llc_snap/g 2003-03-15 15:35:25 +00:00
jlemon
8d19d664ac 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
mdodd
8210352979 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
bd5a16dd86 Use IFP2AC() rather than casting to struct arpcom * 2003-03-03 00:30:02 +00:00
mdodd
f16956aecf De-register. 2003-03-03 00:21:52 +00:00
mdodd
9518102672 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
imp
1493fd6e76 Back out M_* changes, per decision of the TRB.
Approved by: trb
2003-02-19 05:47:46 +00:00
alfred
8f5153c3ea Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
2003-01-21 08:56:16 +00:00
schweikh
c353aec149 Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.
2003-01-01 18:49:04 +00:00
brooks
5cc56ff484 Use if_printf(ifp, "blah") instead of
printf("%s%d: blah", ifp->if_name, ifp->if_xname).
2002-10-21 02:51:56 +00:00
archie
447e501114 Replace (ab)uses of "NULL" where "0" is really meant. 2002-08-22 21:24:01 +00:00
kbyanc
87046fd9e7 Move ISO88025 source routing information into sockaddr_dl's sdl_data
field.  This returns the sdl_data field to a variable-length field.  More
importantly, this prevents a easily-reproduceable data-corruption bug when
the interface name plus the hardware address exceed the sdl_data field's
original 12 byte limit.  However, token-ring interfaces may still overflow
the new sdl_data field's 46 byte limit if the interface name exceeds 6
characters (since 6 characters for interface name plus 6 for hardware
address plus 34 for source routing = the size of sdl_data).  Further
refinements could overcome this limitation but would break binary
compatibility; this commit only addresses fixing the bug for
commonly-occuring cases without breaking binary compatibility with the
intention that the functionality can be MFC'ed to -stable.

  See message ID's (both send to -arch):
	20020421013332.F87395-100000@gateway.posi.net
	20020430181359.G11009-300000@gateway.posi.net
  for a more thorough description of the bug addressed and how to
reproduce it.

Approved by:	silence on -arch and -net
Sponsored by:	NTT Multimedia Communications Labs
MFC after:	1 week
2002-05-07 22:14:06 +00:00
jlemon
34739c7b6d whitespace fixes. 2001-12-14 19:32:47 +00:00
fjoe
1dffb702e4 bring in ARP support for variable length link level addresses
Reviewed by:	jdp
Approved by:	jdp
Obtained from:	NetBSD
MFC after:	6 weeks
2001-10-14 20:17:53 +00:00
jlemon
3413c758de Wrap array accesses in macros, which also happen to be lvalues:
ifnet_addrs[i - 1]  -> ifaddr_byindex(i)
        ifindex2ifnet[i]    -> ifnet_byindex(i)

This is intended to ease the conversion to SMPng.
2001-09-06 02:40:43 +00:00
jlemon
9418e7748e Do not perform arp send/resolve on an interface marked NOARP.
PR: 25006
MFC after: 2 weeks
2001-06-15 21:00:32 +00:00