summaryrefslogtreecommitdiffstats
path: root/usr.sbin/arp/arp.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Pull in <sys/time.h> for gettimeofday()guenther2016-08-271-1/+2
| | | | ok deraadt@
* Replace the /dev/bpf* open loop with a plain open("/dev/bpf0", ...).natano2016-05-281-28/+3
| | | | ok deraadt jca
* Kill undocumented "pro" command. It's a no-op since the 90s!mpi2016-03-231-9/+7
|
* Rename 'rtn' to 'error' for coherency.mpi2016-03-231-11/+10
|
* Remove code to print the never set SIN_PROXY bit. This flag is only usedmpi2016-03-231-2/+1
| | | | | | to set the 33rd bit of a 32bit address in the routing table. ok millert@
* Use an unsigned int rather than an int when iterating through all 32mmcc2016-01-261-2/+2
| | | | | | | | | | | bits in the form: for (i = 1; i; i <<= 1) This avoids undefined operations when shifting into and out of the highest-order bit. ok millert@
* remove undocumented message about trailerstedu2015-12-081-4/+2
|
* I messed up reading the call graph. -d delete does use search, so aderaadt2015-10-141-4/+1
| | | | late pledge is not possible in this way.
* Change all tame callers to namechange to pledge(2).deraadt2015-10-091-5/+5
|
* use new tame "route" feature when possiblederaadt2015-10-071-7/+9
|
* correct a rtget() error checksemarie2015-10-051-2/+2
| | | | | | | | this function could only return 0 or 1, and 1 on error. avoid to deref an uninitialised variable if rtget() return an error. ok millert@ benno@ deraadt@
* arp uses a non-privileged sockraw to look at the kernel arp tables.deraadt2015-10-031-3/+7
| | | | | | | the function to do that is called a number of times, but as needed. hoist it upwards into initization, then tame "stdio dns inet" is possible in most code paths. (there may be further work to do here here) i believe florian helped me with this.
* Explicitly request the sockaddr_dl when doing a RTM_GET rather thanmpi2015-06-031-12/+52
| | | | | | | | | assuming that it will be in the gateway sa. Fixes a regression introduced with the support of multiple connected routes, found the hardway by deraadt@. ok claudio@
* Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt2015-01-161-3/+3
| | | | | | | | | possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
* Remove useless comment, snprintf and if/else.bluhm2014-09-071-5/+2
| | | | OK mpi@
* Be coherent in the way arp(8) and ndp(8) display local entries andmpi2014-09-031-3/+6
| | | | | | | | | use a new flag `l' to ditinguish them. Also skip broadcast entries, they are not reall ARP entries and will never be resolved to anything, requested by deraadt@. ok bluhm@
* print leading 0's in MAC addresses again, ok deraadtsthen2014-08-221-2/+2
|
* Change the output of arp(8) to match what ndp(8) does and include thempi2014-08-211-38/+121
| | | | | | | | | | | | | expire timer. This will makes it easier to add further information in a coherent way between these tools for local and broadcast entries. This new view displays either symbolic names (by default) or numerical addresses (with "-n") for hosts but not both at the same time, just like ndp(8), route(8) or netstat(1) do. ok henning@
* Entries for broadcast addresses should also be ignored, just like localmpi2014-08-191-2/+2
| | | | | | entries. ok florian@, mikeb@, henning@
* Do not try to delete RTF_LOCAL entries. Such routes are automaticallympi2014-08-111-14/+17
| | | | | | | created /deleted by the kernel when an IP address is added/removed on/from an interface and should not be manipulated by userland tools. ok henning@, jca@
* Put AF_ROUTE socket that arp(8) operates on into the appropriate rdomain.mikeb2014-03-181-1/+5
| | | | | | | | | | | | Previously "arp -V 1 -d 10.0.0.1" would hang forever since while the target rdomain was passed in the rtm, the AF_ROUTE socket was always created in the rdomain 0. Due to the logic in route_input (rtsock.c) route socket's rdomain is compared against the target rdomain of the request and reply is generated only when they match. In our case rdomains were different which cased arp(8) to hang waiting for the reply that would never be sent. ok deraadt
* There is no need to init a global to 0claudio2014-02-261-2/+2
|
* Reduce the warnings when arp, rarp, ndp are compiled with WARNINGS=yes.bluhm2013-08-151-4/+4
| | | | | warning: declaration of 'time' shadows a global declaration No binary change; OK lteo@ florian@ henning@ mikeb@ millert@
* arp and rarpd used an int expire_time for time calculation. Convertbluhm2013-07-201-4/+5
| | | | | this into time_t. OK benno@
* create realloc() loops around sysctl for array-based mibs, in programsderaadt2013-03-211-11/+17
| | | | | which want a "full" dump ok dlg
* When running route -Tx exec arp -an, arp would always use the defaultphessler2012-11-081-1/+2
| | | | | | | routing domain. Fix it so we use the process rdomain, but still allow command line overrides. noticed by, and OK, mikeb@
* Add Wake on Lan support to arp(8). This is partly based on the originaljasper2011-01-111-4/+198
| | | | | | | | | wake(8) program. One can specify an interface to send on, or simply broadcast on all available interfaces. Initial input from stsp@, further help from claudio@ and deraadt@. ok claudio@ deraadt@ manpage bits ok jmc@
* a usage line got too long; ok jmcderaadt2009-09-271-3/+3
|
* Same code as in route(8) same RTM_VERSION check missing.claudio2009-06-251-2/+3
| | | | Tested and OK sthen@, OK henning@
* more rtm->rtm_hdrlen conversionchris2009-06-051-2/+2
| | | | ok claudio@
* One more tool that knows about other domains via -Vclaudio2009-06-051-8/+20
|
* Use rtm_hdrlen to jump over the message header and to the beginning of theclaudio2008-12-121-3/+4
| | | | | sockaddrs included in the message. This makes the code more robust when kernel and userland are out of sync. put it in deraadt@
* "usage:" should precede the first statement onlysobrado2008-03-121-2/+2
| | | | ok jmc@
* backout the change to make arp(8) default to -an;thib2008-02-141-4/+1
| | | | | | Remove that blurp from the man page also. requested by deraadt@;
* Oops. Better diff to enable -an by default without breakingthib2008-02-071-4/+4
| | | | | | the other options too badly; ok millert@
* make arp(8) default to -na when called with no arguments;thib2008-02-071-1/+4
| | | | | | man page bit from jmc@ ok millert@, oga@, laurent@
* Yet another application that does not check if the RTM_VERSION is the expectedclaudio2007-08-241-1/+3
| | | | one. Luckily it seems that only show is affected. OK henning@
* Use sizeof(buf) instead of hard coded numbers.ray2007-02-181-2/+2
| | | | | | From Charles Longeau <chl at tuxfamily dot org> long ago. OK moritz@.
* simplify synopsis; ok deraadtjmc2006-05-261-7/+3
|
* Remove "S" from getopt(3) string, which was added in 1.32 by mistake.moritz2006-04-181-2/+2
| | | | From Steffen Wendzel. ok henning@
* shrinkderaadt2005-04-041-13/+7
|
* nlist.h not neededderaadt2005-04-041-2/+1
|
* clean further, theo okhenning2005-03-291-12/+1
|
* make this a bit more readablehenning2005-03-291-64/+71
|
* add -F to force replacement of entries with -s and -fhenning2005-03-291-6/+14
| | | | | inspired by a diff from Mike Belopuhov <mkb@cvs.hnet.spb.ru>, these semantics with theo, manpage jaredy jmc and bob, ok bob
* Enable ARP table manipulation on CARP interfaces.pascoe2005-01-041-4/+4
| | | | ok niklas@ mcbride@
* memory leak; andrushock@korovino.netderaadt2003-06-271-2/+3
|
* remove unused variablesderaadt2003-06-271-6/+5
|
* some ansification, some de-registerderaadt2003-06-111-35/+17
|
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-7/+3
| | | | rescinded 22 July 1999. Proofed by myself and Theo.