summaryrefslogtreecommitdiffstats
path: root/sys/net/if_ef.c
Commit message (Collapse)AuthorAgeFilesLines
* Return mbuf pointer or NULL from ip_fastforward() as the mbuf pointerandre2006-01-181-1/+1
| | | | | | | | | | | 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
* Check the right ifnet pointer to see if if_alloc() failed or not inrwatson2006-01-131-1/+3
| | | | | | | | | | ef_clone(); we were testing the original ifnet, not the one allocated. When aborting ef_clone() due to if_alloc() failing, free the allocated efnet structure rather than leaking it. Noticed by: Coverity Prevent analysis tool MFC after: 3 days
* When freeing the chain of if_ef devices on an aborted load, userwatson2006-01-131-2/+2
| | | | | | | | SLIST_FOREACH_SAFE() rather than SLIST_FOREACH(), as elements are freed on each iteration of the loop. This prevents use-after-free. Noticed by: Coverity Prevent analysis tool MFC after: 3 days
* - Store pointer to the link-level address right in "struct ifnet"ru2005-11-111-5/+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-3/+3
| | | | | | | | | | | | | | 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
* Stop embedding struct ifnet at the top of driver softcs. Instead thebrooks2005-06-101-25/+18
| | | | | | | | | | | | | | | | | | | | 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
* When neither of supported frame type is enabled via kernel options enablesobomax2005-03-061-0/+9
| | | | | | | | | | them all, otherwise the driver will be useless and will only confuse user as manual page says nothing about the need to enable one of those frame types explicitly in the kernel config. PR: kern/47152 Submitted by: Andriy Gapon <avg@icyb.net.ua> MFC after: 3 days
* Initialize ; variable eraly to shut up GCC warning.kan2004-07-281-0/+1
|
* Do a pass over all modules in the kernel and make them return EOPNOTSUPPphk2004-07-151-1/+1
| | | | | | | | for unknown events. A number of modules return EINVAL in this instance, and I have left those alone for now and instead taught MOD_QUIESCE to accept this as "didn't do anything".
* Replace IF_HANDOFF with new IFQ_HANDOFF to enqueue with ALTQ once enabled onmlaier2004-06-151-1/+3
| | | | the respective drivers.
* Remove another redundant if_output initialization.mux2004-05-241-1/+0
|
* o eliminate widespread on-stack mbuf use for bpf by introducingsam2003-12-281-7/+1
| | | | | | | | | | | | | a new bpf_mtap2 routine that does the right thing for an mbuf and a variable-length chunk of data that should be prepended. o while we're sweeping the drivers, use u_int32_t uniformly when when prepending the address family (several places were assuming sizeof(int) was 4) o return M_ASSERTVALID to BPF_MTAP* now that all stack-allocated mbufs have been eliminated; this may better be moved to the bpf routines Reviewed by: arch@ and several others
* Introduce ip_fastforward and remove ip_flow.andre2003-11-141-1/+1
| | | | | | | | | | | | | | | 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-13/+13
| | | | | | | | | | | | | 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)
* Remove break after return.phk2003-05-311-3/+0
| | | | Found by: FlexeLint
* Update netisr handling; Each SWI now registers its queue, and all queuejlemon2003-03-041-49/+46
| | | | | | | | | | 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
* sizeof(struct llc) -> LLC_SNAPFRAMELENmdodd2003-03-031-1/+1
| | | | | sizeof(struct ether_header) -> ETHER_HDR_LEN sizeof(struct fddi_header) -> FDDI_HDR_LEN
* Back out M_* changes, per decision of the TRB.imp2003-02-191-5/+5
| | | | Approved by: trb
* 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.
* SMP locking for ifnet list.hsu2002-12-221-1/+4
|
* network interface and link layer changes:sam2002-11-151-20/+11
| | | | | | | | | | | | 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
* Fix warning; remove unused arg that was passed through uninitialized.peter2002-05-241-2/+2
|
* Swap a bzero for an M_ZERO. Borris approved this ages ago, butdwmalone2002-04-101-2/+1
| | | | | | | the hard drive with the patch on it went south before I committed it. Approved by: bp
* Update to C99, s/__FUNCTION__/__func__/,obrien2001-12-101-2/+2
| | | | also don't use ANSI string concatenation.
* Wrap array accesses in macros, which also happen to be lvalues:jlemon2001-09-061-2/+2
| | | | | | | ifnet_addrs[i - 1] -> ifaddr_byindex(i) ifindex2ifnet[i] -> ifnet_byindex(i) This is intended to ease the conversion to SMPng.
* Another round of the <sys/queue.h> FOREACH transmogriffer.phk2001-02-041-2/+1
| | | | | Created with: sed(1) Reviewed by: md5(1)
* Mechanical change to use <sys/queue.h> macro API instead ofphk2001-02-041-1/+1
| | | | | | | fondling implementation details. Created with: sed(1) Reviewed by: md5(1)
* Use <sys/queue.h> macro api rather than fondle its implementation detals.phk2001-02-031-3/+3
| | | | | Created with: /usr/bin/sed Reviewed by: /sbin/md5
* Fix breakage caused by incomplete transition to IF_HANDOFF().bp2001-02-011-2/+2
| | | | Remove unused variable.
* * Rename M_WAIT mbuf subsystem flag to M_TRYWAIT.bmilekic2000-12-211-2/+2
| | | | | | | | | | | | | | | | | | This is because calls with M_WAIT (now M_TRYWAIT) may not wait forever when nothing is available for allocation, and may end up returning NULL. Hopefully we now communicate more of the right thing to developers and make it very clear that it's necessary to check whether calls with M_(TRY)WAIT also resulted in a failed allocation. M_TRYWAIT basically means "try harder, block if necessary, but don't necessarily wait forever." The time spent blocking is tunable with the kern.ipc.mbuf_wait sysctl. M_WAIT is now deprecated but still defined for the next little while. * Fix a typo in a comment in mbuf.h * Fix some code that was actually passing the mbuf subsystem's M_WAIT to malloc(). Made it pass M_WAITOK instead. If we were ever to redefine the value of the M_WAIT flag, this could have became a big problem.
* Convert more malloc+bzero to malloc+M_ZERO.dwmalone2000-12-081-2/+2
| | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
* Lock down the network interface queues. The queue mutex must be obtainedjlemon2000-11-251-15/+3
| | | | | | | | | | | | | | before adding/removing packets from the queue. Also, the if_obytes and if_omcasts fields should only be manipulated under protection of the mutex. IF_ENQUEUE, IF_PREPEND, and IF_DEQUEUE perform all necessary locking on the queue. An IF_LOCK macro is provided, as well as the old (mutex-less) versions of the macros in the form _IF_ENQUEUE, _IF_QFULL, for code which needs them, but their use is discouraged. Two new macros are introduced: IF_DRAIN() to drain a queue, and IF_HANDOFF, which takes care of locking/enqueue, and also statistics updating/start if necessary.
* Properly setup link level header length for 802.2 and SNAP frames.bp2000-09-301-4/+7
|
* Make all Ethernet drivers attach using ether_ifattach() and detach usingarchie2000-07-131-3/+1
| | | | | | | | | ether_ifdetach(). The former consolidates the operations of if_attach(), ng_ether_attach(), and bpfattach(). The latter consolidates the corresponding detach operations. Reviewed by: julian, freebsd-net
* Back out the previous change to the queue(3) interface.jake2000-05-261-2/+2
| | | | | | It was not discussed and should probably not happen. Requested by: msmith and others
* Change the way that the queue(3) structures are declared; don't assume thatjake2000-05-231-2/+2
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* Fix support for 802.2 and SNAP frames. Bug was introduced duringbp2000-04-271-19/+49
| | | | | | initial import. Tested by: Jorge P Vasquez <jorge@acron.ind.br>
* Allow if_ef driver to be compiled into kernel.bp2000-01-231-0/+1
|
* Bring up an if_ef driver which allows support for four ethernetbp1999-12-131-0/+595
frame types. Currently it supports only IPX protocol and doesn't affect existing functionality when not loaded. Reviewed by: Ollivier Robert <roberto@keltia.freenix.fr>
OpenPOWER on IntegriCloud