summaryrefslogtreecommitdiffstats
path: root/sys/netinet/if_ether.c
Commit message (Collapse)AuthorAgeFilesLines
* Solve the 'unregistered netisr 18' information notice with a sledgehammer.peter2002-06-201-4/+7
| | | | | | Register the ISR early, but do not actually kick off the timer until we see some activity. This still saves us from running the arp timers on a system with no network cards.
* Reset token-ring source routing control field on receipt of ethernet framekbyanc2002-05-151-0/+1
| | | | | without source routing information. This restores the behaviour in this scenario to that of prior to my last commit.
* Move ISO88025 source routing information into sockaddr_dl's sdl_datakbyanc2002-05-071-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | field. This returns the sdl_data field to a variable-length field. More importantly, this prevents a easily-reproduceable data-corruption bug when the interface name plus the hardware address exceed the sdl_data field's original 12 byte limit. However, token-ring interfaces may still overflow the new sdl_data field's 46 byte limit if the interface name exceeds 6 characters (since 6 characters for interface name plus 6 for hardware address plus 34 for source routing = the size of sdl_data). Further refinements could overcome this limitation but would break binary compatibility; this commit only addresses fixing the bug for commonly-occuring cases without breaking binary compatibility with the intention that the functionality can be MFC'ed to -stable. See message ID's (both send to -arch): 20020421013332.F87395-100000@gateway.posi.net 20020430181359.G11009-300000@gateway.posi.net for a more thorough description of the bug addressed and how to reproduce it. Approved by: silence on -arch and -net Sponsored by: NTT Multimedia Communications Labs MFC after: 1 week
* Change callers of mtx_init() to pass in an appropriate lock type name. Injhb2002-04-041-1/+1
| | | | | | | most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used. Tested on: i386, alpha, sparc64
* Send periodic ARP requests when ARP entries for hosts we are sendingorion2002-03-201-0/+15
| | | | | | | | | | to are about to expire. This prevents high packet rate flows from experiencing packet drops at the sender following ARP cache entry timeout. PR: kern/25517 Reviewed by: luigi MFC after: 7 days
* Remove __P.alfred2002-03-191-9/+9
|
* Minor style fix.jlemon2001-12-131-2/+2
|
* Fixed remotely exploitable DoS in arpresolve().ru2001-12-051-1/+3
| | | | | | | | | Easily exploitable by flood pinging the target host over an interface with the IFF_NOARP flag set (all you need to know is the target host's MAC address). MFC after: 0 days
* If we are bridging, fall back to using any inet address in the system,jlemon2001-10-251-4/+9
| | | | | | irrespective of receive interface, as a last resort. Submitted by: ru
* Only examine inet addresses of the interface. This was broken in r1.83,jlemon2001-10-201-2/+4
| | | | with the result that the system would reply to an ARP request of 0.0.0.0
* Pull post-4.4BSD change to sys/net/route.c from BSD/OS 4.2.ru2001-10-171-3/+3
| | | | | | | | | | | | | | | | | | | | Have sys/net/route.c:rtrequest1(), which takes ``rt_addrinfo *'' as the argument. Pass rt_addrinfo all the way down to rtrequest1 and ifa->ifa_rtrequest. 3rd argument of ifa->ifa_rtrequest is now ``rt_addrinfo *'' instead of ``sockaddr *'' (almost noone is using it anyways). Benefit: the following command now works. Previously we needed two route(8) invocations, "add" then "change". # route add -inet6 default ::1 -ifp gif0 Remove unsafe typecast in rtrequest(), from ``rtentry *'' to ``sockaddr *''. It was introduced by 4.3BSD-Reno and never corrected. Obtained from: BSD/OS, NetBSD MFC after: 1 month PR: kern/28360
* bring in ARP support for variable length link level addressesfjoe2001-10-141-99/+155
| | | | | | | Reviewed by: jdp Approved by: jdp Obtained from: NetBSD MFC after: 6 weeks
* Add a hash table that contains the list of internet addresses, and usejlemon2001-09-291-17/+24
| | | | | this in place of the in_ifaddr list when appropriate. This improves performance on hosts which have a large number of IP aliases.
* Fix sysctl comment field, s/the the/then thealfred2001-09-041-1/+1
| | | | Pointed out by: ru
* Allow disabling of "arp moved" messages.alfred2001-09-031-6/+12
| | | | Submitted by: Stephen Hurd <deuce@lordlegacy.org>
* Do not perform arp send/resolve on an interface marked NOARP.jlemon2001-06-151-1/+9
| | | | | PR: 25006 MFC after: 2 weeks
* Add a missing m_pullup() before a mtod() in in_arpinput().yar2001-03-271-0/+6
| | | | | PR: kern/22177 Reviewed by: wollman
* Sync with the bridge/dummynet/ipfw code already tested in stable.luigi2001-02-101-9/+4
| | | | | In ip_fw.[ch] change a couple of variable and field names to avoid having types, variables and fields with the same name.
* Fix bad patch from a few days ago. It broke some bridging.julian2001-02-051-9/+10
|
* Mechanical change to use <sys/queue.h> macro API instead ofphk2001-02-041-3/+3
| | | | | | | fondling implementation details. Created with: sed(1) Reviewed by: md5(1)
* Make the code act the same in the case of BRIDGE being defined, but notjulian2001-02-031-16/+26
| | | | | | | turned on, and the case of it not being defined at all. i.e. Disabling bridging re-enables some of the checks it disables. Submitted by: "Rogier R. Mulhuijzen" <drwilco@drwilco.net>
* provide a sysctl 'net.link.ether.inet.log_arp_wrong_iface' to allow onealfred2001-01-061-0/+7
| | | | | | | | to supress logging when ARP replies arrive on the wrong interface: "/kernel: arp: 1.2.3.4 is on dc0 but got reply from 00:00:c5:79:d0:0c on dc1" the default is to log just to give notice about possibly incorrectly configured networks.
* Lock down the network interface queues. The queue mutex must be obtainedjlemon2000-11-251-1/+12
| | | | | | | | | | | | | | 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.
* Extra sanity check when arp proxyall is enabled. Don't send an arpdwmalone2000-07-131-0/+26
| | | | | | | | | | reply if the requesting machine isn't on the interface we believe it should be. Prevents arp wars when you plug cables in the wrong way around. PR: 9848 Submitted by: Ian Dowse <iedowse@maths.tcd.ie> Not objected to by: wollman
* 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
* PR: kern/17872wes2000-04-111-10/+3
| | | | Submitted by: csg@waterspout.com (C. Stephen Gunn)
* Peter Johnson found another log() call without a trailing newline.joerg2000-03-291-1/+1
| | | | | | | All three of them have been introduced in rev 1.64, so i guess i've got all of them now. :) Submitted by: Peter Johnson <locke@mcs.net>
* Added two missing newlines in calls to log(9).joerg2000-03-281-2/+2
| | | | | | | | Reported in Usenet by: locke@mcs.net (Peter Johnson) While i was at it, prepended a 0x to the %D output, to make it clear that the printed value is in hex (i assume %D has been chosen over %#x to obey network byte order).
* Fix parens in m_pullup() line in arp handling code. The code wasdillon2000-03-231-1/+1
| | | | | | | improperly doing the equivalent of (m = (function() == NULL)) instead of ((m = function()) == NULL). This fixes a NULL pointer dereference panic with runt arp packets.
* o Replace most magic numbers related to token ring with #defineslile2000-03-191-30/+31
| | | | | | | | | | from iso88025.h. o Add minimal llc support to iso88025_input. o Clean up most of the source routing code. * Submitted by: Nikolai Saoukh <nms@otdel-1.org>
* The function arpintr() incorrectly checks m->m_len to detect incompleterwatson2000-03-111-13/+36
| | | | | | | | | | | | | | ARP packets. This can incorrectly reject complete frames since the frame could be stored in more than one mbuf. The following patches fix the length comparisson, and add several diagnostic log messages to the interrupt handler for out-of-the-norm ARP packets. This should make ARP problems easier to detect, diagnose and fix. Submitted by: C. Stephen Gunn <csg@waterspout.com> Approved by: jkh Reviewed by: rwatson
* Clean up some loose ends in the network code, including the X.25 and ISOpeter2000-02-131-3/+1
| | | | | | | #ifdefs. Clean out unused netisr's and leftover netisr linker set gunk. Tested on x86 and alpha, including world. Approved by: jkh
* Append missing newline to log() message for permanent ARP modificationsheldonh1999-10-181-1/+1
| | | | | | | attempt warning, which was added in rev 1.48 . PR: 14371 Submitted by: sec@pi.musin.de (Stefan `Sec` Zehl)
* Re-arrange the arp code so that fddi arps work properly.lile1999-09-161-29/+46
|
* It is much easier to arp if you don't truncate your arp-reply's.lile1999-08-281-11/+12
| | | | [affects token-ring only]
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Add sufficient braces to keep egcs happy about potentially ambiguouspeter1999-05-061-2/+3
| | | | if/else nesting.
* Better handling for ARP/source routing on Token Ringeivind1999-04-151-8/+16
| | | | Submitted by: Larry Lile <lile@stdio.com>
* Submitted by: Larry Lilejulian1999-03-101-16/+79
| | | | | | | | Move the Olicom token ring driver to the officially sanctionned location of /sys/contrib. Also fix some brokenness in the generic token ring support. Be warned that if_dl.h has been changed and SOME programs might like recompilation.
* arprequest() allocates an mbuf with m_gethdr() but does not initializewpaul1999-03-041-1/+2
| | | | m->m_pkthdr.rcvif to NULL. Bad arprequest(). No biscuit.
* World, I'd like you to meet the first FreeBSD token Ring driver.julian1999-02-201-3/+8
| | | | | | | | This is for various Olicom cards. An IBM driver is following. This patch also adds support to tcpdump to decode packets on tokenring. Congratulations to the proud father.. (below) Submitted by: Larry Lile <lile@stdio.com>
* * Change sysctl from using linker_set to construct its tree using SLISTs.dfr1999-02-161-1/+3
| | | | | | | | | | This makes it possible to change the sysctl tree at runtime. * Change KLD to find and register any sysctl nodes contained in the loaded file and to unregister them when the file is unloaded. Reviewed by: Archie Cobbs <archie@whistle.com>, Peter Wemm <peter@netplex.com.au> (well they looked at it anyway)
* Fix bug in last commit (la was used uninitialized if no route was passed in).fenner1999-01-191-2/+2
|
* If arpresolve() gets passed a route with a null llinfo, callfenner1999-01-181-2/+2
| | | | | | | arplookup() to try again. This gets rid of at least one user's "arpresolve: can't allocate llinfo" errors, and arplookup() gives better error messages to help track down the problem if there really is a problem with the routing table.
* Remove check from where arp replies are coming from -- when doing bridging,luigi1999-01-101-1/+3
| | | | interfaces are used in clusters so the check does not apply.
* Last bits (i think) of dummynet for -current.luigi1998-12-141-1/+11
|
* Prevent modification of permanent ARP entries (PR kern/7649)fenner1998-09-171-4/+21
| | | | | Ignore ARP replies from the wrong interface (discussion on mailing list) Add interface name to a couple of error messages
* Go through the loopback code with a broom..julian1998-06-121-10/+10
| | | | | | | | | | | | | | | | Remove lots'o'hacks. looutput is now static. Other callers who want to use loopback to allow shortcutting should call the special entrypoint for this, if_simloop(), which is specifically designed for this purpose. Using looutput for this purpose was problematic, particularly with bpf and trying to keep track of whether one should be using the charateristics of the loopback interface or the interface (e.g. if_ethersubr.c) that was requesting the loopback. There was a whole class of errors due to this mis-use each of which had hacks to cover them up. Consists largly of hack removal :-)
* This commit fixes various 64bit portability problems required fordfr1998-06-071-3/+3
| | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time.
OpenPOWER on IntegriCloud