summaryrefslogtreecommitdiffstats
path: root/sys/netinet/if_ether.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove global list of all llinfo_arp entries and use a callout perglebius2007-03-221-50/+23
| | | | | | | | instance expiry of the ARP entries. Since we no longer abuse the IPv4 radix head lock, we can now enter arp_rtrequest() with a lock held on an arbitrary rt_entry. Reviewed by: bms
* Comply with RFC 3927, by forcing ARP replies which contain a sourcebms2007-02-021-1/+13
| | | | | | | | address within the link-local IPv4 prefix 169.254.0.0/16, to be broadcast at link layer. Reviewed by: fenner MFC after: 2 weeks
* o Increment requests counter right before send out an ARP query actually.maxim2007-01-141-1/+2
| | | | | | | | Otherwise the code could lead to the spurious EHOSTDOWN errors. PR: kern/107807 Submitted by: Dmitrij Tejblum MFC after: 1 month
* Complete break-out of sys/sys/mac.h into sys/security/mac/mac_framework.hrwatson2006-10-221-1/+2
| | | | | | | | | | | | | begun with a repo-copy of mac.h to mac_framework.h. sys/mac.h now contains the userspace and user<->kernel API and definitions, with all in-kernel interfaces moved to mac_framework.h, which is now included across most of the kernel instead. This change is the first step in a larger cleanup and sweep of MAC Framework interfaces in the kernel, and will not be MFC'd. Obtained from: TrustedBSD Project Sponsored by: SPARTA
* Save space on stack moving token ring stuff to its own hack block.glebius2006-10-041-2/+3
|
* Style rev. 1.152.glebius2006-10-041-2/+2
|
* now that we don't automagicly increase the MTU of host routes, when we copyjmg2006-09-231-1/+3
| | | | | the loopback interface, copy it's mtu also.. This means that we again have large mtu support for local ip addresses...
* There is a consensus that ifaddr.ifa_addr should never be NULL,yar2006-06-291-1/+1
| | | | | | | | | | except in places dealing with ifaddr creation or destruction; and in such special places incomplete ifaddrs should never be linked to system-wide data structures. Therefore we can eliminate all the superfluous checks for "ifa->ifa_addr != NULL" and get ready to the system crashing honestly instead of masking possible bugs. Suggested by: glebius, jhb, ru
* Enable proxy ARP answers on any of the bridged interfaces if proxy recordthompsa2006-06-091-3/+6
| | | | | | | | belongs to another interface within the bridge group. PR: kern/94408 Submitted by: Eygene A. Ryabinkin MFC after: 1 month
* Further refine the bridge hack in the arp code. Only do the special arpthompsa2006-03-071-2/+2
| | | | | | | handling for interfaces which are actually in the bridge group, ignore all others. MFC after: 3 days
* Now that the bridge also processes Ethernet frames as itself, two arp repliesthompsa2006-01-311-2/+4
| | | | | | | | | will be sent if there is an address on the bridge. Exclude the bridge from the special arp handling. This has been tested with all combinations of addresses on the bridge and members. Pointed out by: Michal Mertl
* Back out of r1.148, it causes two arp replies to be sent with different macthompsa2006-01-291-1/+1
| | | | | addresses. One for the bridged interface with the IP address assigned but then another with the mac for the bridge itself.
* Include the bridge interface itself in the special arp handling.thompsa2006-01-121-1/+1
| | | | | PR: 90973 MFC after: 1 week
* Add a knob to suppress logging of attempts to modifyglebius2005-12-181-6/+11
| | | | | | permanent ARP entries. Submitted by: Andrew Alcheyev <buddy telenet.ru>
* Add descriptions for sysctl -d.emaste2005-12-161-5/+5
| | | | | Approved by: glebius Silence from: rwatson (mentor)
* Rework ARP retransmission algorythm so that ARP requests areglebius2005-11-081-30/+27
| | | | | | | | | | | | | | | retransmitted without suppression, while there is demand for such ARP entry. As before, retransmission is rate limited to one packet per second. Details: - Remove net.link.ether.inet.host_down_time - Do not set/clear RTF_REJECT flag on route, to avoid rt_check() returning error. We will generate error ourselves. - Return EWOULDBLOCK on first arp_maxtries failed requests , and return EHOSTDOWN/EHOSTUNREACH on further requests. - Retransmit ARP request always, independently from return code. Ratelimit to 1 pps.
* When bridging is enabled and an ARP request is recieved on a member interface,thompsa2005-10-041-1/+1
| | | | | | | | | | | | | | | | | the arp code will search all local interfaces for a match. This triggers a kernel log if the bridge has been assigned an address. arp: ac:de:48:18:83:3d is using my IP address 192.168.0.142! bridge0: flags=8041<UP,RUNNING,MULTICAST> mtu 1500 inet 192.168.0.142 netmask 0xffffff00 ether ac:de:48:18:83:3d Silence this warning for 6.0 to stop unnecessary bug reports, the code will need to be reworked. Approved by: mlaier (mentor) MFC after: 3 days
* Remove bridge(4) from the tree. if_bridge(4) is a full functionalmlaier2005-09-271-3/+1
| | | | | | | | replacement and has additional features which make it superior. Discussed on: -arch Reviewed by: thompsa X-MFC-after: never (RELENG_6 as transition period)
* Use monotonic 'time_uptime' instead of 'time_second' as timebaseandre2005-09-191-7/+7
| | | | for rt->rt_rmx.rmx_expire.
* - Do not hold route entry lock, when calling arprequest(). One suchglebius2005-09-091-9/+17
| | | | | | | | | | | | | | | | | | | | | | | | | call was introduced by me in 1.139, the other one was present before. - Do all manipulations with rtentry and la before dropping the lock. - Copy interface address from route into local variable before dropping the lock. Supply this copy as argument to arprequest() LORs fixed: http://sources.zabbadoz.net/freebsd/lor/003.html http://sources.zabbadoz.net/freebsd/lor/037.html http://sources.zabbadoz.net/freebsd/lor/061.html http://sources.zabbadoz.net/freebsd/lor/062.html http://sources.zabbadoz.net/freebsd/lor/064.html http://sources.zabbadoz.net/freebsd/lor/068.html http://sources.zabbadoz.net/freebsd/lor/071.html http://sources.zabbadoz.net/freebsd/lor/074.html http://sources.zabbadoz.net/freebsd/lor/077.html http://sources.zabbadoz.net/freebsd/lor/093.html http://sources.zabbadoz.net/freebsd/lor/135.html http://sources.zabbadoz.net/freebsd/lor/140.html http://sources.zabbadoz.net/freebsd/lor/142.html http://sources.zabbadoz.net/freebsd/lor/145.html http://sources.zabbadoz.net/freebsd/lor/152.html http://sources.zabbadoz.net/freebsd/lor/158.html
* When we have a published ARP entry for some IP address, do reply onglebius2005-08-251-0/+9
| | | | | | | | | | | ARP requests only on the network where this IP address belong, to. Before this change we did replied on all interfaces. This could lead to an IP address conflict with host we are doing ARP proxy for. PR: kern/75634 Reviewed by: andre
* o Fix a race between three threads: output path,glebius2005-08-111-155/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | incoming ARP packet and route request adding/removing ARP entries. The root of the problem is that struct llinfo_arp was accessed without any locks. To close race we will use locking provided by rtentry, that references this llinfo_arp: - Make arplookup() return a locked rtentry. - In arpresolve() hold the lock provided by rt_check()/arplookup() until the end of function, covering all accesses to the rtentry itself and llinfo_arp it refers to. - In in_arpinput() do not drop lock provided by arplookup() during first part of the function. - Simplify logic in the first part of in_arpinput(), removing one level of indentation. - In the second part of in_arpinput() hold rtentry lock while copying address. o Fix a condition when route entry is destroyed, while another thread is contested on its lock: - When storing a pointer to rtentry in llinfo_arp list, always add a reference to this rtentry, to prevent rtentry being destroyed via RTM_DELETE request. - Remove this reference when removing entry from llinfo_arp list. o Further cleanup of arptimer(): - Inline arptfree() into arptimer(). - Use official queue(3) way to pass LIST. - Hold rtentry lock while reading its structure. - Do not check that sdl_family is AF_LINK, but assert this. Reviewed by: sam Stress test: http://www.holm.cc/stress/log/cons141.html Stress test: http://people.freebsd.org/~pho/stress/log/cons144.html
* In preparation for fixing races in ARP (and probably in otherglebius2005-08-091-0/+1
| | | | L2/L3 mappings) make rt_check() return a locked rtentry.
* Add hooks into the networking layer to support if_bridge. This changes structthompsa2005-06-051-4/+8
| | | | | | | ifnet so a buildworld is necessary. Approved by: mlaier (mentor) Obtained from: NetBSD
* Embrace with #ifdef DEV_CARP carp-related code.glebius2005-03-131-2/+7
|
* Make ARP do not complain about wrong interface if correct interfaceglebius2005-03-091-7/+14
| | | | | | is a carp one and address matched it. Reviewed by: brooks
* Add CARP (Common Address Redundancy Protocol), which allows multipleglebius2005-02-221-5/+34
| | | | | | | | | | | | | hosts to share an IP address, providing high availability and load balancing. Original work on CARP done by Michael Shalayeff, with many additions by Marco Pfatschbacher and Ryan McBride. FreeBSD port done solely by Max Laier. Patch by: mlaier Obtained from: OpenBSD (mickey, mcbride)
* /* -> /*- for license, minor formatting changesimp2005-01-071-1/+1
|
* More fixing of multiple addresses in the same prefix. This time do not trymlaier2004-12-091-2/+20
| | | | | | | | to arp resolve "secondary" local addresses. Found and submitted by: ru With additions from: OpenBSD (rev. 1.47) Reviewed by: ru
* Check that rt_mask(rt) is non-NULL before dereferencing it, in thebms2004-10-261-0/+1
| | | | | | RTM_ADD case, thus avoiding a panic. Submitted by: Iasen Kostov
* Modify the thrilling "%D is using my IP address %s!" message so thatrwatson2004-10-121-1/+7
| | | | | | it isn't printed if the IP address in question is '0.0.0.0', which is used by nodes performing DHCP lookup, and so constitute a false positive as a report of misconfiguration.
* Check flag do_bridge always, even if kernel was compiled withoutglebius2004-09-091-11/+5
| | | | | | | | BRIDGE support. This makes dynamic bridge.ko working. Reviewed by: sam Approved by: julian (mentor) MFC after: 1 week
* Add a new driver to support IP over firewire. This driver is intended todfr2004-06-131-1/+2
| | | | | | | | conform to the rfc2734 and rfc3146 standard for IP over firewire and should eventually supercede the fwe driver. Right now the broadcast channel number is hardwired and we don't support MCAP for multicast channel allocation - more infrastructure is required in the firewire code itself to fix these problems.
* Another small set of changes to reduce diffs with the new arp code.luigi2004-04-251-31/+18
|
* remove a stale comment on the behaviour of arpresolveluigi2004-04-251-10/+0
|
* Start the arp timer at init time.luigi2004-04-251-10/+1
| | | | It runs so rarely that it makes no sense to wait until the first request.
* This commit does two things:luigi2004-04-251-7/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* Replace Bcopy with 'the real thing' as in the rest of the file.luigi2004-04-181-1/+1
|
* Remove advertising clause from University of California Regent'simp2004-04-071-4/+0
| | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson
* + arpresolve(): remove an unused argumentluigi2004-04-041-7/+2
| | | | | | | | | + struct ifnet: remove unused fields, move ipv6-related field close to each other, add a pointer to l3<->l2 translation tables (arp,nd6, etc.) for future use. + struct route: remove an unused field, move close to each other some fields that might likely go away in the future
* - Fix indentation lost by 'diff -b'.mdodd2004-03-211-5/+4
| | | | - Un-wrap short line.
* Remove interface type specific code from arprequest(), and in_arpinput().mdodd2004-03-211-111/+19
| | | | | | | The AF_ARP case in the (*if_output)() routine will handle the interface type specific bits. Obtained from: NetBSD
* De-register.mdodd2004-03-141-22/+22
|
* I didn't notice it right away, but check the right length too.ru2003-12-231-1/+1
|
* Fix a problem introduced in revision 1.84: m_pullup() does notru2003-12-231-5/+7
| | | | | necessarily return the same mbuf chain so we need to recompute mtod() consumers after pulling up.
* replace explicit changes to rt_refcnt by RT_ADDREF and RT_REMREFsam2003-11-081-1/+1
| | | | | | | macros that expand to include assertions when the system is built with INVARIANTS Supported by: FreeBSD Foundation
* o add a flags parameter to netisr_register that is used to specifysam2003-11-081-1/+1
| | | | | | | | | | | | | | | | whether or not the isr needs to hold Giant when running; Giant-less operation is also controlled by the setting of debug_mpsafenet o mark all netisr's except NETISR_IP as needing Giant o add a GIANT_REQUIRED assertion to the top of netisr's that need Giant o pickup Giant (when debug_mpsafenet is 1) inside ip_input before calling up with a packet o change netisr handling so swi_net runs w/o Giant; instead we grab Giant before invoking handlers based on whether the handler needs Giant o change netisr handling so that netisr's that are marked MPSAFE may have multiple instances active at a time o add netisr statistics for packets dropped because the isr is inactive Supported by: FreeBSD Foundation
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-10-311-11/+10
| | | | | | | | | | | | | 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)
* Overhaul routing table entry cleanup by introducing a new rtexpungesam2003-10-301-8/+3
| | | | | | | | | | | | routine that takes a locked routing table reference and removes all references to the entry in the various data structures. This eliminates instances of recursive locking and also closes races where the lock on the entry had to be dropped prior to calling rtrequest(RTM_DELETE). This also cleans up confusion where the caller held a reference to an entry that might have been reclaimed (and in some cases used that reference). Supported by: FreeBSD Foundation
* Locking for updates to routing table entries. Each rtentry gets a mutexsam2003-10-041-32/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that covers updates to the contents. Note this is separate from holding a reference and/or locking the routing table itself. Other/related changes: o rtredirect loses the final parameter by which an rtentry reference may be returned; this was never used and added unwarranted complexity for locking. o minor style cleanups to routing code (e.g. ansi-fy function decls) o remove the logic to bump the refcnt on the parent of cloned routes, we assume the parent will remain as long as the clone; doing this avoids a circularity in locking during delete o convert some timeouts to MPSAFE callouts Notes: 1. rt_mtx in struct rtentry is guarded by #ifdef _KERNEL as user-level applications cannot/do-no know about mutex's. Doing this requires that the mutex be the last element in the structure. A better solution is to introduce an externalized version of struct rtentry but this is a major task because of the intertwining of rtentry and other data structures that are visible to user applications. 2. There are known LOR's that are expected to go away with forthcoming work to eliminate many held references. If not these will be resolved prior to release. 3. ATM changes are untested. Sponsored by: FreeBSD Foundation Obtained from: BSD/OS (partly)
OpenPOWER on IntegriCloud