summaryrefslogtreecommitdiffstats
path: root/sys/netinet/if_ether.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert rtdeletemsg conversion. It was not ok'd, I misunderstood bluhm@'smpi2015-01-281-9/+2
| | | | email.
* Do not always try to rtfree(9) route entries inside rtdeletemsg(9).mpi2015-01-261-2/+9
| | | | | | | Instead check the error code returned by this function and let the caller free the route entry when appropriate. ok bluhm@
* Only notify userland about resolved ARP entries if the Ethernet addressmpi2015-01-131-3/+6
| | | | | | | | changed or if we asked for it. Should reduce the RTM_RESOLVE storm seeing by claudio@ With inputs from and ok mikeb@
* Factorize various duplicated chunks of (old and horrible) code, checkingmpi2015-01-081-13/+23
| | | | | | | | | | | | | | | | | | | | | | | | | for the validity of a given outgoing route entry into a single function. This change is inspired from FreeBSD r111767. The function introduced here, rt_checkgate(), should hopefully die in a near future. Why should it die? Well, it is way too late to do such validity checks: if your kernel can ends up in ether_output() with an invalid route, please do not let it try to find a new one that might do the job. Go read this function if you're wondering why you're getting messages like: "arpresolve: X.X.X.X: route without link local address" Since this horrible logic has survived 20 years of copy & past and small modifications for workarounds without a single clear commit message, let's assume it is full of dragons and try to play safe. This factorization is not intended to change any behavior. With much inputs from bluhm@, tested by weerd@ and florian@ on setups with p2p IPv6 interfaces. ok bluhm@, benno@, florian@
* unifdef INET in net code as a precursor to removing the pretend option.tedu2014-12-191-3/+1
| | | | | long live the one true internet. ok henning mikeb
* Explicitly include <net/if_var.h> instead of pulling it in <net/if.h>.mpi2014-12-051-1/+2
| | | | ok mikeb@, krw@, bluhm@, tedu@
* Rename rtalloc1() into rtalloc(9) and convert its flags to only enablempi2014-11-011-3/+6
| | | | | | functionnality instead of a mix of enable/disable. ok bluhm@, jca@
* Make sure broadcast entries won't be freed by the arp timer so we canmpi2014-09-031-2/+15
| | | | | | | | use them for address lookups. While here do let in_arpinput() overwrite local or broadcast entries. ok mikeb@, florian@
* Revert the addition of broadcast addresses, it apparently also corruptsmpi2014-08-261-13/+1
| | | | the tree. Found by millert@.
* When a local route entry is added for an ifa having a broadcast address,mpi2014-08-191-1/+13
| | | | | | | | | | | | | | | also adds a broadcast entry flagged with RTF_BROADCAST. Prior to this change broadcast entries were simple clonned ARP entries, that would be deleted once their timer expired since they would always be incomplete. With this change they are now persistant and identifiable with a new flag. Committing early to be able to deal with any potential fallout before we start relying on this. ok florian@, mikeb@, henning@
* Use the RTF_LOCAL flag instead of abusing the RTF_LLINFO flag whenmpi2014-08-111-2/+2
| | | | | | | adding local route entries. This hack made sense when we didn't have the RTF_LOCAL flag, but since some months it is set on every local route.
* Convert ARP llinfo allocation to pool(9).mpi2014-08-111-3/+8
| | | | ok henning@, dlg@
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-2/+2
| | | | after discussions with beck deraadt kettenis.
* Always create a local route for every configured IPv4 address on thempi2014-07-121-3/+5
| | | | | | | | | | | | | | | | machine and restore the original behavior of RTM_ADD and RTM_DELETE by always generating one message per locally configured address. This time, make sure the local route is removed during an address change, since at least pppoe(4) do some funky magics with wildcard addresses that might corrupt the routing tree, as found by naddy@ Also do not add a local route if the specified address is 0.0.0.0, to prevent a tree corruption, as found by guenther@. Putting this in now so that it gets tested, claudio@ agrees. Please contact me if you find any route-related regression caused by this change.
* Revert "Always create a local route for every configured IPv4 address",mpi2014-06-161-5/+3
| | | | | | it introduces a regression with default routes & p2p interfaces. Problem reported by naddy@
* Always create a local route for every configured IPv4 address on thempi2014-06-111-3/+5
| | | | | | | machine and restore the original behavior of RTM_ADD and RTM_DELETE by always generating one message per locally configured address. Tested by krw@, jca@ and florian@
* Kill the {nd6_,}useloopback buttons, using the loopback interface formpi2014-05-071-21/+3
| | | | | | local traffic is not optional. ok mikeb@, stsp@, jca@
* Use a custom ifa_rtrequest function for point-to-point interfacesmpi2014-05-051-1/+7
| | | | | | | | | | instead of relying on hacks in nd6_rtrequest() to add a route to loopback for each address configured on such interfaces. While here document that abusing lo0 for local traffic is not safe for interfaces in a non-default rdomain. Tested by claudio@, jca@ and sthen@, ok sthen@
* "struct pkthdr" holds a routing table ID, not a routing domain one.mpi2014-04-141-4/+4
| | | | | | | | | | | | | | 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@
* notify userland when arp entry is removed; ok mpimikeb2014-04-101-6/+2
|
* Stop mixing interface address flags with routing entry ones.mpi2014-03-271-2/+1
| | | | | | | | | | Instead of always copying ifa_flags to the routing entry flags when creating a route by calling rtinit(), explicitly pass the RTF_CLONING flag when required. This means ifa_flags are now *only* used to check if an address has an associated route that was created by the kernel auto-magically. ok benno@
* Notify userland via the routing socket when ARP resolution completes;mikeb2014-03-181-1/+2
| | | | discussed with claudio@ at n2k14, ok mpi
* Rename rt_gettable() into rtable_get(), swap its arguments to bempi2014-03-181-2/+2
| | | | | | coherent with the existing rtable_* functions and document it. While here fix some other manpage glitches pointed out by jmc@.
* Remove gratuitous differences between arp and nd6 rtrequests,mpi2014-03-111-17/+14
| | | | | | no functional change. ok jca@
* if_lladdr -> if_sadl, no functional change.mpi2014-03-101-2/+2
| | | | ok mikeb@
* Remove genmask support from the kernel. rtmsgs with RTA_GENMASK set willclaudio2014-01-221-3/+1
| | | | | | now cause a EINVAL. The RTA_GENMASK and RTAX_GENMASK defines are kept for compatibility reasons. OK benno@ and agreed by dlg@
* replace the rest of the obsolete radix macrostedu2014-01-101-7/+7
| | | | | sprinkle 0 -> NULL where obvious ok millert mpi
* replace Bcopy macro with memmove and memcpy. ok mpitedu2014-01-091-4/+5
|
* bzero/bcmp -> memset/memcmp. ok matthewtedu2014-01-091-11/+11
|
* bcopy -> memcpy. reviewed with one fix from matthewtedu2013-12-311-37/+28
|
* Since r1.106 we have a local variable referencing the receiving interface,mpi2013-11-271-3/+2
| | | | use it instead of dereferencing the mbuf once again. No functional change.
* Replace the last usage of IA_SIN() and kill this macro.mpi2013-11-211-3/+3
| | | | ok henning@, sthen@, mikeb@, deraadt@
* Replace most of our formating functions to convert IPv4/6 addresses frommpi2013-11-111-13/+23
| | | | | | | | network to presentation format to inet_ntop(). The few remaining functions will be soon converted. ok mikeb@, deraadt@ and moral support from henning@
* Convert the route expire timestamp in kernel and routing messagebluhm2013-10-311-2/+2
| | | | | | | | | | | | | to 64 bit. Increase the routing message version from 4 to 5. Add a small compatibility layer that allows to set routes with old user land and new kernel. Old kernel with new user land does not work. The compatibility layer ist not perfect, but it allows to configure addresses with old ifconfig and new kernel. Route get also works in this setup. dhclient hangs as messages for interface address changes with old version are not generated. OK claudio@
* tedu FDDI support and the 3 flavors the driver for DEC devices, evenmpi2013-10-281-31/+2
| | | | | | | | miod@ cannot find two boards using the same media. With precious punctuation review from guenther@, thanks! ok deraadt@, henning@
* By passing invalid values in the routing message, root could crashbluhm2013-10-141-2/+2
| | | | | the kernel from user land. Add a null pointer check as quick fix. OK blambert@ claudio@
* Use satosin() rather than the local SIN macro, no functional change.mpi2013-09-031-11/+11
| | | | ok mikeb@
* Iterate over the interface's address list instead of the global list.mpi2013-08-291-38/+35
| | | | ok bluhm@, mikeb@
* Remove unused argument from *rtrequest()mpi2013-08-281-2/+2
| | | | ok krw@, mikeb@
* Constify the default null sockaddr_dl, no functional change.mpi2013-08-091-3/+4
| | | | ok mikeb@
* Do not use a static variable to perform a lookup. While thismpi2013-08-011-2/+3
| | | | | | | | is perfectly ok for the moment because there might be at most one caller at a time, it wont be so as soon as this part of the network stack is run in parallel. ok henning@, mikeb@
* Rewrite the function used to determine if we do proxy ARP for one ofmpi2013-07-041-1/+30
| | | | | | our addresses to reuse arplookup() and do only one list iteration. Looks ok to claudio@, ok mikeb@
* code that calls timeout functions should include timeout.htedu2013-03-281-1/+2
| | | | | slipped by on i386, but the zaurus doesn't automagically pick it up. spotted by patrick
* no need for a lot of code to include proc.htedu2013-03-281-3/+1
|
* Unfortunately the satosin, sintosa, ifatoia, satosin6, sin6tosa,bluhm2013-03-281-2/+2
| | | | | | | ifatoia6 macros do not check the source type. They just cast anything. Remove needless casts and do not use those macros if the source type does not match. Remove duplicate defines. No binary change. OK kettenis@ krw@
* simple replacement of LIST_END with NULL. ok mpitedu2013-03-221-3/+2
|
* Remove the IFAFREE() macro, the ifafree() function it was calling alreadympi2013-03-071-2/+2
| | | | | | check for the reference counter. ok mikeb@, miod@, pelikan@, kettenis@, krw@
* Move revarp code into #ifdef NFSCLIENT; saving space on some media.deraadt2012-10-181-17/+26
| | | | | | | Resurrect the rather silly "unplug my network device while I am doing nfs diskless revarp" safety code which was disabled due to a missing "ether.h" include, found by jsg ok jsg
* Point an interface directly to its bridgeport configuration, insteadcamield2012-10-051-4/+13
| | | | | | | | | | 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
* missing NCARP define and fix indentcamield2012-10-051-8/+10
|