summaryrefslogtreecommitdiffstats
path: root/sys/net/if_ethersubr.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-3/+3
| | | | after discussions with beck deraadt kettenis.
* pull the rx ring accounting out of the mbuf layer now that its all donedlg2014-07-081-3/+1
| | | | | | | | | | via if_rxring things. this effectively deprecates the third argument for MCLGETI and m_clget and makes the mbuf layer no longer care about interfaces and simplifies the allocation paths. the timeout used to measure livelock has been moved to net/if.c. ok mpi@
* NULL is cooler than 0 when pointers are concernedhenning2014-04-221-6/+6
| | | | ok gcc & md5 (aka no binary change)
* we used to handle the vlan tag etc insertion very very very late,henning2014-04-221-5/+35
| | | | | | | | | | | | | | | on al already ass embed ethernet frame, which meant: -copy (most of) the existing ethernet header into a ether_vlan_header on the stack -fill the extra fields in ether_vlan_header -set the ether type -m_adj() to make room for the extra space ether_vlan_header needs -m_copyback the ether_vlan_header into the mbuf that involves moving data around, which isn't all that cheap. cleaner & easier to have ether_output prepend the ether_vlan_header instead of the regular ethernet header, which makes the vlan tagging essentially free in most cases. help & ok reyk, naddy; waste of time bikeshedding tech@
* g/c hdrcmplt var, we can just set the esrc ptr earlier and re-set it inhenning2014-04-211-5/+3
| | | | the pseudo_AF_HDRCMPLT case, ok claudio reyk
* __inline -> inlinehenning2014-04-211-3/+3
|
* factor our ether_addheader for readability; there's more to come therehenning2014-04-201-11/+20
| | | | ok claudio reyk
* ether_output: instead of assembling the ethernet header and then callinghenning2014-04-201-6/+5
| | | | | | | carp_rewrite_lladdr to overwrite the src lladdr, get the intended src lladdr before assembling the ethernet header. carp_rewrite_lladdr -> carp_get_srclladdr ok reyk claudio
* ether_output: instead of using an esrc buffer in which we copy the intendedhenning2014-04-201-9/+9
| | | | | | src lladdr just to copy it from the esrc buffer into the ethernet header a few lines later, use an esrc pointer to figure out where to copy the src lladdr from. ok claudio reyk
* "struct pkthdr" holds a routing table ID, not a routing domain one.mpi2014-04-141-6/+6
| | | | | | | | | | | | | | Avoid the confusion by using an appropriate name for the variable. Note that since routing domain IDs are a subset of the set of routing table IDs, the following idiom is correct: rtableid = rdomain But to get the routing domain ID corresponding to a given routing table ID, you must call rtable_l2(9). claudio@ likes it, ok mikeb@
* bcmp -> memcmpmpi2014-03-261-7/+7
|
* No need to check here if the destination address is ours, because inmpi2014-03-261-9/+1
| | | | | | such case loouput() is called not ether_output(). ok claudio@, mikeb@
* Convert bcopy()s to memcpy()s.mpi2014-02-171-22/+20
| | | | ok pelikan@, tedu@
* Pass the receiving interface pointer to carp_input() instead of re-mpi2014-01-221-4/+2
| | | | | | | reading it from the packet header. While here makes carp_input() take the same arguments as ether_input(). ok bluhm@, mikeb@
* Replaces a lookup to find the link-layer address by accessing the if_sadlmpi2014-01-161-15/+6
| | | | | | member directly. ok mikeb@
* use arc4random() for ether_fakeaddr, because it is safederaadt2013-11-181-3/+2
| | | | ok tedu
* Remove the number of in_var.h inclusions by moving some functions andmpi2013-10-231-4/+1
| | | | | | global variables to in.h. ok mikeb@, deraadt@
* ansi function declarations.dlg2013-06-051-22/+9
| | | | ok sha256
* Replace "hot" bcopy() calls in ether_output() with memcpy(). This tells thekettenis2013-06-031-6/+5
| | | | | | | | | compiler that source and destination are not overlapping, allowing for more aggressive optimization, leading to a significant performance improvement on busy firewalls. Reworking of a diff by dlg@, who did the hard work of benchmarking this. ok deraadt@, mikeb@, henning@, mcbride@, tedu@, matthew@
* do not include machine/cpu.h from a .c file; it is the responsibility ofderaadt2013-03-281-2/+1
| | | | | .h files to pull it in, if needed ok tedu
* change LIST_END to literal NULL for clarity.tedu2013-03-151-2/+2
| | | | ok claudio mpi
* Relax the restriction on sending frames to trunk(4) members to allow BPF writes.sthen2013-01-181-2/+4
| | | | Method (checking for PACKET_TAG_DLT) suggested by claudio, ok mpf
* Point an interface directly to its bridgeport configuration, insteadcamield2012-10-051-8/+7
| | | | | | | | | | of to the bridge itself. This is ok, since an interface can only be part of one bridge, and the parent bridge is easy to find from the bridgeport. This way we can get rid of a lot of list walks, improving performance and shortening the code. ok henning stsp sthen reyk
* begone, fucking rotten appletalk shit. ok roomhenning2011-07-091-109/+1
|
* Include PIPEX in kernel by default. And add new sysctl variableyasuoka2011-07-081-7/+7
| | | | | | | | `net.pipex.enable' to enable PIPEX. By default, pipex is disabled and it will not process packets from wire. Update man pages and update HOWTO_PIPEX_NPPPD.txt for testers. discussed with dlg@, ok deraadt@ mcbride@ claudio@
* Say no to hand-rolled m_adj(). It also kills three XXX.claudio2011-07-041-4/+2
| | | | OK dlg@ henning@
* Change an m_free() to m_freem() to free the whole mbuf chain and to preventreyk2011-01-281-2/+2
| | | | | | | a possible memory leak with bpf's BIOCSFILDROP option which is currently used by dhcpd and dhclient. Found by gollo@
* Remove some commented code we will never have.claudio2010-10-111-9/+2
|
* legibility fixes:blambert2010-08-241-5/+7
| | | | | | | | | 1) one statement per line 2) label gets its own line, and doesn't share it with a statement no functional change "Let the turd shine." claudio@
* Some functions change the ifp in during ether_input(). This confuses theclaudio2010-07-021-2/+2
| | | | | | | IFF_PROMISC check that ensures that only local packets make it into the network stack. Check both the original ifp and the new ifp for IFF_PROMISC. Problem identified by Patrick Coleman. OK mcbride@, henning@
* Add support for 802.1ad-style QinQ nested VLANs.naddy2010-06-031-4/+5
| | | | | | | | | | QinQ-compliant svlan (service VLAN) interfaces are implemented as a new cloner type, use Ethernet type 0x88a8, and have a dedicated VLAN tag hash to avoid ID conflicts. vlan(4) interfaces can be stacked on top of svlan(4). Originally from reyk@, input from claudio@ and deraadt@ ok claudio@
* Rework the way we handle MPLS in the kernel. Instead of fumbling MPLS intoclaudio2010-05-281-15/+6
| | | | | | | | | | | ether_output() and later on other L2 output functions use a trick and over- load the ifp->if_output() function pointer on MPLS enabled interfaces to go through mpls_output() which will then call the link level output function. By setting IFXF_MPLS on an interface the output pointers are switched. This now allows to cleanup the MPLS input and output pathes and fix mpe(4) so that the MPLS code now actually works for both P and PE systems. Tested by myself and michele (A custom kernel with MPLS and mpe enabled is still needed).
* Start cleaning up the mess called rtalloc*. Kill rtalloc2, make rtalloc1claudio2010-05-071-4/+4
| | | | | | | | accept flags for report and nocloning. Move the rtableid into struct route (with a minor twist for now) and make a few more codepathes rdomain aware. Appart from the pf.c and route.c bits the diff is mostly mechanical. More to come... OK michele, henning
* incomming -> incomingmk2010-05-011-2/+2
| | | | | | The ones found in gnu/ left out by intention. ok jmc
* document the first byte of the random MAC addressderaadt2010-04-031-1/+2
|
* After calling pipex_pppoe_input(), we must goto done to restore the spl.yasuoka2010-01-121-2/+2
| | | | ok mcbride@
* Unify the various fake ethernet generators as ether_fakeaddr() whichderaadt2010-01-121-15/+21
| | | | | | is safe for both hardware devices and virtual devices ok mpf, kettenis, moaning and groaning and slow acceptance from mcbride XXX should loop checking for uniqueness after new henning diff goes in
* Initial import PIPEX. PIPEX(Pppac IP EXtension) is a IP forwardingyasuoka2010-01-111-3/+16
| | | | | | acceleration for PPP access concentrator. ok mcbride@ dlg@ deraadt@ reyk@.
* rtables are stacked on rdomains (it is possible to have multiple routingclaudio2009-11-031-7/+6
| | | | | | | | | | | | | | tables on top of a rdomain) but until now our code was a crazy mix so that it was impossible to correctly use rtables in that case. Additionally pf(4) only knows about rtables and not about rdomains. This is especially bad when tracking (possibly conflicting) states in various domains. This diff fixes all or most of these issues. It adds a lookup function to get the rdomain id based on a rtable id. Makes pf understand rdomains and allows pf to move packets between rdomains (it is similar to NAT). Because pf states now track the rdomain id as well it is necessary to modify the pfsync wire format. So old and new systems will not sync up. A lot of help by dlg@, tested by sthen@, jsg@ and probably more OK dlg@, mpf@, deraadt@
* revert my change to m_cluncount which tries to prevent the systemdlg2009-08-121-9/+2
| | | | | | | | | | running out of mbufs for rx rings. if the system low watermark is lower than a rx rings low watermark, we'll never send a packet up the stack, we'll always recycle it. found by thib@ on a bge sadface
* if we get dangerously low on clusters during interrupts, we needdlg2009-08-121-2/+9
| | | | | | | | | | | | | to free some for use on the rx rings on network cards. this modifies m_cluncount to advise callers when we're in such a situation, and makes them responsible for freeing up the cluster for allocation by MCLGETI later. fixes an awesome lockup with sis(4) henning has been experiencing. this is not the best fix, but it is better than the current situation. yep deraadt@ tested by henning@
* Initial support for routing domains. This allows to bind interfaces toclaudio2009-06-051-4/+19
| | | | | | | | | alternate routing table and separate them from other interfaces in distinct routing tables. The same network can now be used in any doamin at the same time without causing conflicts. This diff is mostly mechanical and adds the necessary rdomain checks accross net and netinet. L2 and IPv4 are mostly covered still missing pf and IPv6. input and tested by jsg@, phessler@ and reyk@. "put it in" deraadt@
* Fix a panic in ether_output() when attempting to send multicast traffic onmichele2009-03-051-2/+2
| | | | | | MPLS enabled kernels. ok claudio@
* Get rid of the ugly rtentry hack.michele2009-01-281-2/+13
| | | | | | | | We can now act as edge node and allow ipv4 packets to enter a Label Switched Path and not just forwarding MPLS packets. OK claudio@
* m_cluncount() needs to walk the mbuf chain to correctly uncount all clustersclaudio2008-11-251-2/+2
| | | | | | but don't do that in m_free() as that will cause a double loop behaviour when called via m_freem(). OK dlg@, deraadt@
* add several backend pools to allocate mbufs clusters of various sizes outdlg2008-11-241-1/+3
| | | | | | | | | | | | | | | | | | | of. currently limited to MCLBYTES (2048 bytes) and 4096 bytes until pools can allocate objects of sizes greater than PAGESIZE. this allows drivers to ask for "jumbo" packets to fill rx rings with. the second half of this change is per interface mbuf cluster allocator statistics. drivers can use the new interface (MCLGETI), which will use these stats to selectively fail allocations based on demand for mbufs. if the driver isnt rapidly consuming rx mbufs, we dont allow it to allocate many to put on its rx ring. drivers require modifications to take advantage of both the new allocation semantic and large clusters. this was written and developed with deraadt@ over the last two days ok deraadt@ claudio@
* softraid support for ata over ethernet (aoe). this includes a client andtedu2008-11-231-1/+10
| | | | | | part of a server. there's no configuration yet, and several other drawbacks, but it can be hammered into shape. i haven't moved the code forward in a year, and marco wants it in the tree to hack on.
* * Allow ether_input() and vlan_input() to handle incoming packetsnaddy2008-10-161-3/+4
| | | | | | | | where the tag is stored in the mbuf header. * Make bridge(4) handle interfaces with and without hardware tag support and forward packets inbetween. Help and ok claudio@
* Add fallback ioctl handlers for MTU and multicast to ether_ioctl().brad2008-10-091-8/+23
|
* First step towards cleaning up the Ethernet driver ioctl handling.brad2008-10-021-3/+2
| | | | | | | | | | | | | | | | | | | | Move calling ether_ioctl() from the top of the ioctl function, which at the moment does absolutely nothing, to the default switch case. Thus allowing drivers to define their own ioctl handlers and then falling back on ether_ioctl(). The only functional change this results in at the moment is having all Ethernet drivers returning the proper errno of ENOTTY instead of EINVAL/ENXIO when encountering unknown ioctl's. Shrinks the i386 kernels by.. RAMDISK - 1024 bytes RAMDISKB - 1120 bytes RAMDISKC - 832 bytes Tested by martin@/jsing@/todd@/brad@ Build tested on almost all archs by todd@/brad@ ok jsing@