summaryrefslogtreecommitdiffstats
path: root/sys/netinet/if_ether.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Kill the RT_REPORT flag to rtalloc() and stop sending RTM_MISS messagesclaudio2015-12-021-2/+2
| | | | | | for failed route lookups. This is something that was maybe useful in the 90is but in this modern times it is just annoying and nothing expect it anyway. OK mpi@, sthen@
* Do not delete a conflicting & cloned route entry in the hot path.mpi2015-12-021-6/+3
| | | | | | | Deleting a RTF_CLONED entry without deleting its corresponding RTF_CLONING entry wont help as it will be cloned the next time arplookup() is executed. ok claudio@
* Remove backward compatibility for "older version of routed and gated".mpi2015-12-011-9/+1
| | | | ok millert@, bluhm@
* This no longer depends on bridge.h, fewer "#ifdef NBRIDGE", say yeah!mpi2015-11-201-6/+1
|
* Fewer uses of rt_ifp.mpi2015-11-201-6/+16
| | | | Tested by and ok sthen@,
* Factorize the bits to check if a L2 route is connected, wether it ismpi2015-11-181-13/+2
| | | | | | | attached to a carp(4) or bridge(4) member, to not dereference rt_ifp directly. ok visa@
* Make use of srp_enter()/srp_leave() in carp_iamatch() in preparationmpi2015-11-181-20/+11
| | | | | | for unlocking the ARP input path. ok dlg@
* Sore the index of the interface used for revarp instead of a pointer tompi2015-11-131-9/+12
| | | | | | its descriptor. Get rid of a if_ref(). ok dlg@
* In in_arpinput() do not make an extra route lookup to check wetherbluhm2015-11-061-20/+11
| | | | | | the sender address is a local IP. The arplookup() does this route lookup anyway, so just check its result. OK mpi@
* In in_arpinput() replace the loops over the interface addressesbluhm2015-11-051-50/+36
| | | | | | | with route lookups. Check wether ARP sender or target protocol address is a local IP address. Remove the loop that checks wether any IPv4 address is configured on the receiving interface. input, test, OK mpi@
* use ml_purge to flush the arp hold lists instead of dequeue/free loops.dlg2015-11-041-14/+4
| | | | | | | | | | | | | | | | this is an interesting change because the loops have to decrement the global hold count too. they looked like this: while ((mh = ml_dequeue(&la->la_ml)) != NULL) { la_hold_total--; m_freem(mh); } because ml_purge returns how many mbufs were freed, we can do this: la_hold_total -= ml_purge(&la->la_ml); ok mpi@ bluhm@
* Retire ARP load-balacing, thanks for all the fish!mpi2015-11-021-15/+8
| | | | | | | | | One of the keys of our MP work relies on making OpenBSD's kernel simpler! In this case turning ARP processing MP-safe is quite complicated due to the way carp(4) is hooked in arpinput() and nowadays you'd better run kitchensinkd(9) anyway :) ok bluhm@, claudio@, reyk@
* Rename the list of arp entries to arp_list. This is consistent tobluhm2015-11-021-6/+5
| | | | | | the other arp variables and nd6. Convert a hand-crafted loop to LIST_FOREACH_SAFE. OK mpi@
* Replace the nd6 llinfo malloc(9) with pool_get(9) like arp does.bluhm2015-11-011-2/+2
| | | | OK mpi@
* RIP arp_ifinit().mpi2015-10-271-6/+1
|
* Move code around for clarity, no functional change.mpi2015-10-271-10/+14
| | | | ok bluhm@
* Introduce if_rtrequest() the successor of ifa_rtrequest().mpi2015-10-251-4/+2
| | | | | | | | | L2 resolution depends on the protocol (encoded in the route entry) and an ``ifp''. Not having to care about an ``ifa'' makes our life easier in our MP effort. Fewer dependencies between data structures implies fewer headaches. Discussed with bluhm@, ok claudio@
* Drop historical comment and an old '#if notyet'.mpi2015-10-221-18/+2
|
* Make sure that the address matching the key (destination) of a routempi2015-10-221-11/+2
| | | | | | entry is attached to this entry. ok phessler@, bluhm@
* Inspired by satosin(), use inline functions to convert sockaddr dl.bluhm2015-10-221-11/+9
| | | | | | Instead of casts they check wether the incoming object has the expected type. So introduce satosdl() and sdltosa() in the kernel. OK mpi@
* Do not pass an ``ia'' just to dereference ``ia_ifp''.mpi2015-10-221-2/+2
| | | | ok claudio@, bluhm@, jsg@
* Simplify arptfree() to no longer look at the route entry's refcounter.mpi2015-10-131-17/+8
| | | | | | | | ARP entries with an expired timeout are now removed from the tree even if they are cached somehwere else. This also reduces differences with NDP. ok bluhm@
* Move route entry debug helpers where they belong.mpi2015-10-071-107/+1
|
* Do not manually decrement rt's refcounter in arplookup() and let thempi2015-09-281-25/+35
| | | | | | callers rtfree(9) it. ok bluhm@
* Fix uninitalized use of variable.claudio2015-09-161-2/+3
| | | | | Issue _17 found by Maxime Villard Brainy scanner. OK bluhm@
* There's no point in abstracting ifp->if_output() as long as pf_test()mpi2015-09-131-5/+5
| | | | | | needs to see lo0 in the output path. ok claudio@
* queue revarps to softnet so we can defer processing to a context withdlg2015-09-131-1/+7
| | | | | | the kernel lock. "do it" claudio@ mpi@
* Stop overwriting the rt_ifp pointer of RTF_LOCAL routes with lo0ifp.mpi2015-09-121-12/+5
| | | | | | | | | Use instead the RTF_LOCAL flag to loop local traffic back to the corresponding protocol queue. With this change rt_ifp is now always the same as rt_ifa->ifa_ifp. ok claudio@
* correctly hold and put a reference to the revarp ifp while tryingdlg2015-09-101-14/+13
| | | | | | to get nfs working. ok claudio@
* Rewrite arpproxy() to no longer iterate on the global list of interfaces.mpi2015-09-091-15/+11
| | | | ok claudio@
* Fix English in comment. OK dlg@claudio2015-09-091-2/+2
|
* KNFmpi2015-08-191-31/+32
|
* Make arplookup() return a pointer to a "struct rtentry".mpi2015-08-191-15/+17
| | | | | | | This is needed for proper refcounting of rtentries and reduce differences with nd6_lookup(). Tweak and ok bluhm@
* Use __func__ rather than the function name in log(9) calls to removempi2015-08-171-8/+8
| | | | some grep output noise.
* Abstract the routing table internals behind an rtable_* API.mpi2015-07-181-13/+5
| | | | | | | | | | Code abusing the radix internals for the routing table should now includes <net/rtable.h> and only deal with "struct rtentry". Code using a radix tree for another purpose can still include <net/radix.h>. Inputs from and ok claudio@, mikeb@
* Announce an IP address after inserting its corresponding RTF_LOCALmpi2015-07-171-9/+6
| | | | | | | route and not during the SIOCSIFADDR ioctl. This way addresses are not announced when an error occurs. ok chris@, claudio@
* Always use "ifp" instead of mixing it with "ac->ac_if" in in_arpinput().mpi2015-07-071-14/+14
|
* Pass a "struct ifnet *" instead of a "struct arpcom *" to arpresolve().mpi2015-06-231-6/+7
| | | | | | | | Most of the ARP layer already take an ifp pointer and this makes clear wich chunks of code are messing with ac_enaddr. Note that our Ethernet code assume that these pointer are interchangeable since the first element of the "struct arpcom" is a "struct ifnet".
* Store a unique ID, an interface index, rather than a pointer to thempi2015-06-161-4/+9
| | | | | | | | | | | | | | | receiving interface in the packet header of every mbuf. The interface pointer should now be retrieved when necessary with if_get(). If a NULL pointer is returned by if_get(), the interface has probably been destroy/removed and the mbuf should be freed. Such mechanism will simplify garbage collection of mbufs and limit problems with dangling ifp pointers. Tested by jmatthew@ and krw@, discussed with many. ok mikeb@, bluhm@, dlg@
* Replace a bunch of == 0 with == NULL in pointer tests. Nuke somekrw2015-06-071-11/+11
| | | | | | | annoying trailing, leading and embedded whitespace. No change to .o files. ok deraadt@
* Do not create ARP entries for RTF_BROADCAST routes.mpi2015-05-261-15/+3
| | | | | | | | | | | | | | | | | This has been done because historically routes to broadcast addresses were cloned like any ARP entry. But for obvious reasons, no matching Ethernet address could ever be resolved. That's why we played tricks with the expire timer. Now that a RTF_BROADCAST route is created per configured IPv4 address, we need to differenciate duplicated one. And by not creating an ARP entry we are allowed to write the IP address in the rt_gateway field, which prevents MPATH conflicts. This change is part of a fix to unbreak aliases since the kernel support multiple connected routes for a subnet. Found the hardway by djm@, ok claudio@
* Allow multiple connected/interface routes to exist at the same time.claudio2015-05-151-15/+1
| | | | | | | | | | | Use the existing multipath code. Switch away from using the ifa address when making the cloning route and instead put a dummy sockaddr_dl route in. With this it is possible to use the same network on multiple interfaces at the same time. So if wireless and ethernet share the same network the system will use the wired connection as long as there is link. Still missing is builtin proxy-arp for the other interface IPs to allow hitless failover. OK mpi@
* Init rt to NULL in arpresolve(). Not a problem in practicejsg2015-04-221-2/+2
| | | | | | | as la will be NULL when rt is uninitialised which should cause the function to return, but makes the code easier to follow. ok mpi@ miod@
* replace the use of ifqueues for most input queues serviced by netisrdlg2015-04-101-10/+6
| | | | | | | | | | | | | | | | | with niqueues. this change is so big because there's a lot of code that takes pointers to different input queues (eg, ether_input picks between ipv4, ipv6, pppoe, arp, and mpls input queues) and falls through to code to enqueue packets against the pointer. if i changed only one of the input queues id have to add sepearate code paths, one for ifqueues and one for niqueues in each of these places by flipping all these input queues at once i can keep the currently common code common. testing by mpi@ sthen@ and rafael zalamena ok mpi@ sthen@ claudio@ henning@
* Convert hand-rolled mbuf list used to store packets until ARPmpi2015-03-241-44/+29
| | | | | | resolution is completed to ml_init(9) API. Tested by kspillner@, inputs & ok dlg@
* Check for the size of the supposed destination address when constructingmpi2015-03-141-1/+8
| | | | | the Ethernet frame. Prevent an overflow reported by Henk Jan Agteresch on bugs@.
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-2/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* Do not store the key and the gateway of a route entry in the same chunkmpi2015-02-111-2/+2
| | | | | | | | | | of memory. The key (destination) is only set once, when the route is inserted in the routing table, and does not need to change afterward. The gateway might change and rt_setgate() will do all the checks for you. ok claudio@
* Print a different error message if the route entry supposed to containmpi2015-02-071-1/+10
| | | | | | ARP information is of a different kind. ok sthen@, claudio@
* Convert various rtrequest1(RTM_DELETE,...) calls to rtdeletemsg(9).mpi2015-02-051-10/+2
| | | | | | This unify some code and notify userland for free. blambert@ agrees, ok bluhm@