summaryrefslogtreecommitdiffstats
path: root/sys/net/if_arcsubr.c
Commit message (Collapse)AuthorAgeFilesLines
* Prefer NULL over 0 for pointerskevlo2012-10-091-1/+1
|
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.ed2011-11-071-1/+1
| | | | This means that their use is restricted to a single C file.
* Tag mbufs of all incoming frames or packets with the interface's FIBbz2011-07-031-0/+1
| | | | | | | | | setting (either default or if supported as set by SIOCSIFFIB, e.g. from ifconfig). Submitted by: Alexander V. Chernikov (melifaro ipfw.ru) Reviewed by: julian MFC after: 2 weeks
* Switch cmd argument to u_long. This matches what if_ethersubr.c does andrdivacky2009-06-211-1/+1
| | | | | | | allows the code to compile cleanly on amd64 with clang. Reviewed by: rwatson Approved by: ed (mentor)
* The llentry *lle is only used in cases of INET or INET6.bz2009-06-101-0/+2
| | | | | | | Put the variable declaration under proper #ifdefs. In case variables are only needed for one of the two AFs more them into proper scope.
* remove call to IFQ_HANDOFF is it called by if_transmit in the default casekmacy2009-04-271-1/+1
| | | | and doing so allows the ifnet driver to define its own queueing mechanism
* Change if_output to take a struct route as its fourth argument in orderkmacy2009-04-161-2/+3
| | | | | | to allow passing a cached struct llentry * down to L2 Reviewed by: rwatson
* Remove the rt argument from nd6_storelladdr() becauseqingli2008-12-171-1/+1
| | | | rt is no longer accessed.
* This main goals of this project are:qingli2008-12-151-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. separating L2 tables (ARP, NDP) from the L3 routing tables 2. removing as much locking dependencies among these layers as possible to allow for some parallelism in the search operations 3. simplify the logic in the routing code, The most notable end result is the obsolescent of the route cloning (RTF_CLONING) concept, which translated into code reduction in both IPv4 ARP and IPv6 NDP related modules, and size reduction in struct rtentry{}. The change in design obsoletes the semantics of RTF_CLONING, RTF_WASCLONE and RTF_LLINFO routing flags. The userland applications such as "arp" and "ndp" have been modified to reflect those changes. The output from "netstat -r" shows only the routing entries. Quite a few developers have contributed to this project in the past: Glebius Smirnoff, Luigi Rizzo, Alessandro Cerri, and Andre Oppermann. And most recently: - Kip Macy revised the locking code completely, thus completing the last piece of the puzzle, Kip has also been conducting active functional testing - Sam Leffler has helped me improving/refactoring the code, and provided valuable reviews - Julian Elischer setup the perforce tree for me and has helped me maintaining that branch before the svn conversion
* Make compile without INET.bz2008-11-051-0/+2
| | | | MFC after: 2 months
* Retire the MALLOC and FREE macros. They are an abomination unto style(9).des2008-10-231-2/+2
| | | | MFC after: 3 months
* Use ANSI C function protypes and declarations for if_arcsubr.rwatson2006-04-121-33/+13
| | | | MFC after: 1 month
* Return mbuf pointer or NULL from ip_fastforward() as the mbuf pointerandre2006-01-181-2/+2
| | | | | | | | | | | may have changed by m_pullup() during fastforward processing. While this is a bug it is actually never triggered in real world situations and it is not remotely exploitable. Found by: Coverity Prevent(tm) Coverity ID: CID780 Sponsored by: TCP/IP Optimization Fundraise 2005
* - Store pointer to the link-level address right in "struct ifnet"ru2005-11-111-1/+1
| | | | | | | | | | rather than in ifindex_table[]; all (except one) accesses are through ifp anyway. IF_LLADDR() works faster, and all (except one) ifaddr_byindex() users were converted to use ifp->if_addr. - Stop storing a (pointer to) Ethernet address in "struct arpcom", and drop the IFP2ENADDR() macro; all users have been converted to use IF_LLADDR() instead.
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andrwatson2005-08-091-1/+2
| | | | | | | | | | | | | | IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to ifnet.if_drv_flags. Device drivers are now responsible for synchronizing access to these flags, as they are in if_drv_flags. This helps prevent races between the network stack and device driver in maintaining the interface flags field. Many __FreeBSD__ and __FreeBSD_version checks maintained and continued; some less so. Reviewed by: pjd, bz MFC after: 7 days
* When allocating link layer ifnet address list entries inrwatson2005-08-021-2/+6
| | | | | | | | | ifp->if_resolvemulti(), do so with M_NOWAIT rather than M_WAITOK, so that a mutex can be held over the call. In the FDDI code, add a missing M_ZERO. Consumers are already aware that if_resolvemulti() can fail. MFC after: 1 week
* Stop embedding struct ifnet at the top of driver softcs. Instead thebrooks2005-06-101-7/+51
| | | | | | | | | | | | | | | | | | | | struct ifnet or the layer 2 common structure it was embedded in have been replaced with a struct ifnet pointer to be filled by a call to the new function, if_alloc(). The layer 2 common structure is also allocated via if_alloc() based on the interface type. It is hung off the new struct ifnet member, if_l2com. This change removes the size of these structures from the kernel ABI and will allow us to better manage them as interfaces come and go. Other changes of note: - Struct arpcom is no longer referenced in normal interface code. Instead the Ethernet address is accessed via the IFP2ENADDR() macro. To enforce this ac_enaddr has been renamed to _ac_enaddr. - The second argument to ether_ifattach is now always the mac address from driver private storage rather than sometimes being ac_enaddr. Reviewed by: sobomax, sam
* /* -> /*- for license, minor formatting changesimp2005-01-071-1/+1
|
* Prefer C99's __func__ over GCC's __FUNCTION__.stefanf2004-09-221-1/+1
|
* Replace IF_HANDOFF with new IFQ_HANDOFF to enqueue with ALTQ once enabled onmlaier2004-06-151-4/+1
| | | | the respective drivers.
* add missing #include <sys/module.h>phk2004-05-301-0/+1
|
* This commit does two things:luigi2004-04-251-16/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* whoops, forgot to fix these places where arpresolve() was usedluigi2004-04-041-1/+1
| | | | Detected by: tinderbox
* MAC addresses are 8 bits in ARCNET. Adjust bcopy().mdodd2004-03-221-2/+2
|
* - Correct variable name.mdodd2004-03-211-2/+2
| | | | | | - Correct unnecessary use of htons(). Reported by: many.
* Handle AF_ARP.mdodd2004-03-211-0/+27
|
* Introduce ip_fastforward and remove ip_flow.andre2003-11-141-2/+2
| | | | | | | | | | | | | | | 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)
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-10-311-4/+4
| | | | | | | | | | | | | if_xname, if_dname, and if_dunit. if_xname is the name of the interface and if_dname/unit are the driver name and instance. This change paves the way for interface renaming and enhanced pseudo device creation and configuration symantics. Approved By: re (in principle) Reviewed By: njl, imp Tested On: i386, amd64, sparc64 Obtained From: NetBSD (if_xname)
* Update netisr handling; Each SWI now registers its queue, and all queuejlemon2003-03-041-15/+8
| | | | | | | | | | 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
* Reduce code duplication. This adds the function rt_check() to route.c.mdodd2003-03-021-22/+3
| | | | Approved by: sam (in principle)
* Back out M_* changes, per decision of the TRB.imp2003-02-191-5/+5
| | | | Approved by: trb
* - bpf is now working (tested with tcpdump)fjoe2003-01-301-9/+16
| | | | | | - fix promiscious mode MFC after: 3 days
* - add support for IPX (tested with mount -t nwfs and mars_nwe),fjoe2003-01-241-82/+157
| | | | | | | | | | | IP fast forwarding, SIOCGIFADDR, setting hardware address (not currently enabled in cm driver), multicasts (experimental) - add ARC_MAX_DATA, use IF_HANDOFF, remove arc_sprintf() and some unused variables - if_simloop logic is made more similar to ethernet - drop not ours packets early (if we are not in promiscous mode) Submitted by: mark tinguely (partially)
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-5/+5
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* network interface and link layer changes:sam2002-11-151-4/+2
| | | | | | | | | | | | o on input don't strip the Ethernet header from packets o input packet handling is now done with if_input o track changes to ether_ifattach/ether_ifdetach API o track changes to bpf tapping o call ether_ioctl for default handling of ioctl's o use constants from net/ethernet.h where possible Reviewed by: many Approved by: re
* Use if_printf(ifp, "blah") instead ofbrooks2002-10-211-2/+1
| | | | printf("%s%d: blah", ifp->if_name, ifp->if_xname).
* Be consistent about functions being static.phk2002-10-161-1/+1
| | | | Spotted by: FlexeLint
* Cosmetical change: remove empty line to reduce diffs to RELENG_4fjoe2002-04-141-1/+0
|
* Fix incorrect m_free - m_freem() usage.luigi2002-04-041-3/+2
|
* Remove __P.alfred2002-03-191-1/+1
|
* - generic Arcnet frameworkfjoe2002-01-081-0/+780
- device driver for SMC COM90cx6 Arcnet network adapters Obtained from: NetBSD
OpenPOWER on IntegriCloud