Commit Graph

97 Commits

Author SHA1 Message Date
roy 2ead7eac29 arp: Permanence is from the llentry, not the route 2020-09-15 11:14:16 +00:00
roy b718bc3ed3 arp: Show U for Unreachable 2020-09-15 10:11:15 +00:00
roy 222abc89f8 arp: Use SIOCGNBRINFO to display neighbor state information 2020-09-11 15:28:29 +00:00
nonaka 2f7c8d4b83 arp(8): one more to close socket. 2019-02-28 01:20:25 +00:00
dholland 2cc9171b5c Teach arp that it's okay to close sockets after using them.
(this requires adding a close op to the rump turds)

Fixes PR 53974 reporting too many open files.
2019-02-27 23:29:50 +00:00
nonaka b62b80c748 arp(8): Fix the host output when arp -dav. 2018-07-31 09:45:52 +00:00
ozaki-r 54f5265e5a arp: warn if failed to delete a specified arp entry
This restores the original behavior of arp in NetBSD 7.
2018-07-11 03:10:48 +00:00
christos a87d179511 Fix the logic for the non auto case 2018-07-07 15:44:27 +00:00
christos 67420ca6b3 Add an "auto" keyword to auto-determine the link address from the inet addr. 2018-07-06 00:50:05 +00:00
nonaka 4312665c73 fix usage of `arp -d'. 2018-06-08 04:24:12 +00:00
christos e68fbebd32 use librumpres 2017-10-10 19:30:41 +00:00
ozaki-r 3f42983046 Enable to remove multiple ARP/NDP entries for one destination
The kernel can have multiple ARP/NDP entries which have an indentical
destination on different interfaces. This is normal and can be
reproduce easily by ping -I or ping6 -S. We should be able to remove
such entries.

arp -d <ip> and ndp -d <ip> are changed to fetch all ARP/NDP entries
and remove matched entries. So we can remove multiple entries
described above. This fetch all and selective removal behavior is
the same as arp <ip> and ndp <ip>; they also do fetch all entries
and show only matched entries.

Related to PR 51179
2017-06-28 08:17:50 +00:00
ozaki-r 60f1157fbd Fix usage of routing messages on arp -d and ndp -d
It didn't work as we expected; we should set RTA_GATEWAY not
RTA_IFP on RTM_GET to return an if_index and the kernel should
use it on RTM_DELETE.
2017-06-26 03:13:40 +00:00
ryo 1a52494ae8 whitespace police 2017-06-06 19:59:10 +00:00
wiz 02b19f3777 Add missing verb. New sentence, new line. 2016-10-16 05:32:30 +00:00
roy 520b96bc5f Document our RFC 5227 implementation. 2016-10-12 08:43:17 +00:00
wiz 4120986a4e Sort sections. 2016-04-04 13:29:12 +00:00
ozaki-r 09973b35ac Separate nexthop caches from the routing table
By this change, nexthop caches (IP-MAC address pair) are not stored
in the routing table anymore. Instead nexthop caches are stored in
each network interface; we already have lltable/llentry data structure
for this purpose. This change also obsoletes the concept of cloning/cloned
routes. Cloned routes no longer exist while cloning routes still exist
with renamed to connected routes.

Noticeable changes are:
- Nexthop caches aren't listed in route show/netstat -r
  - sysctl(NET_RT_DUMP) doesn't return them
  - If RTF_LLDATA is specified, it returns nexthop caches
- Several definitions of routing flags and messages are removed
  - RTF_CLONING, RTF_XRESOLVE, RTF_LLINFO, RTF_CLONED and RTM_RESOLVE
- RTF_CONNECTED is added
  - It has the same value of RTF_CLONING for backward compatibility
- route's -xresolve, -[no]cloned and -llinfo options are removed
  - -[no]cloning remains because it seems there are users
  - -[no]connected is introduced and recommended
    to be used instead of -[no]cloning
- route show/netstat -r drops some flags
  - 'L' and 'c' are not seen anymore
  - 'C' now indicates a connected route
- Gateway value of a route of an interface address is now not
  a L2 address but "link#N" like a connected (cloning) route
- Proxy ARP: "arp -s ... pub" doesn't create a route

You can know details of behavior changes by seeing diffs under tests/.

Proposed on tech-net and tech-kern:
  http://mail-index.netbsd.org/tech-net/2016/03/11/msg005701.html
2016-04-04 07:37:07 +00:00
ozaki-r ed89e004b6 Kill confusable use of SIN_PROXY 2016-02-24 08:01:09 +00:00
ozaki-r 14e1104e9a Reduce abuse of global variables 2015-07-31 04:02:40 +00:00
ozaki-r fe28962804 Introduce rump.arp
arp(8) uses RTM that requires that getpid(2) works correctly. Unfortunately
supporting getpid(2) in librumphijack will be tricky so that we rump-ify
arp(8) as well as ifconfig and route commands.

Suggested by pooka@.
2015-07-29 06:07:35 +00:00
apb c40fe12b6e Use .Cm markup for the keywords "temp", "pub", and "proxy" (suggested
by wiz).  Also bump date.
2013-07-08 04:31:12 +00:00
apb 62d3d9959d "temp", "pub", and "proxy" are keywords, not replaceable
parameters, so do not use ".Ar" markup.  Use either no markup,
or ".Dq" markup, depending on context.
2013-06-07 18:33:53 +00:00
christos ab61edc6b5 allow ifscope with pub and proxy 2013-06-07 17:18:33 +00:00
christos 4d4651f0df Add an ifscope <interface> argument to arp in the spirit of the MacOS/X one,
that sets the arp entry on the interface specified. Undocumented for now,
until people decide it is useful.
2013-06-07 01:09:10 +00:00
wiz 2c1d99899f New sentence, new line. Remove trailing whitespace. 2011-04-25 22:20:29 +00:00
dholland 6ea002c7af Allow -f -, as per PR 10898. 2010-06-10 06:03:20 +00:00
lukem d877c4c3c0 Enable WARNS=4 by default, except for:
cpuctl  dumplfs  hprop  ipf  iprop-log  kadmin  kcm  kdc  kdigest
	kimpersonate  kstash  ktutil  makefs  ndbootd  ntp  pppd  quot
	racoon  racoonctl  rtadvd  sntp  sup  tcpdchk  tcpdmatch  tcpdump
	traceroute  traceroute6  user  veriexecgen  wsmoused  zic
(Mostly third-party applications)
2009-04-22 15:23:01 +00:00
christos af069eb3c7 Centralize the ROUNDUP and ADVANCE macro in a header file, give them an
RT_ prefix and use them appropriately, instead of making copies. Make
pppd use the RT_ROUNDUP macro; fixes proxyarp setting on 64 bit hosts.

XXX: All this should be pulled up to 5.0
2009-04-02 21:02:06 +00:00
lukem 9c1945664c Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
2008-07-21 13:36:57 +00:00
seanb 40918b5ad1 - re-enable 'pro' keyword to allow creation / deletion
of 'proxy only' entries (SIN_PROXY flag set).
2008-01-10 14:16:26 +00:00
perry 8b0f9554ff convert __attribute__s to applicable cdefs.h macros 2007-12-15 19:44:37 +00:00
christos 6fef5d355e WARNS=4.
- pass lint
- don't use sscanf fgets and fixed length buffers
- always use warnx to report errors.
2006-10-22 20:54:38 +00:00
dyoung 8adc537db8 Extract common code from set() and delete() into subroutine
is_llinfo().
2006-09-23 21:11:14 +00:00
christos 5883cf1e6d PR/32681: Yves-Emmanuel JUTARD: Fix and document -d [hostname [pub]] 2006-01-31 17:47:04 +00:00
xtraeme 4d3d91045c Kill __P(), use ANSI function declarations, constify; WARNS=3 2005-03-16 02:04:51 +00:00
atatat c8c0bfb574 Put the rest of the -f description in the right place, while adjusting
the wording and starting a new sentence on a new line.

My turn to play wiz and fix the man page he broke.  :)
2004-11-25 01:41:51 +00:00
wiz 98b8f0e005 Sort options. Second part of PR 26533. 2004-11-17 14:54:47 +00:00
jrf ea0b6a43d0 Add -v option to usage message. 2004-08-14 02:16:13 +00:00
wiz 47190e80b8 Consistently use 'RFC 1234' instead of 'RFC1234' or 'RFC-1234'.
From jmc@openbsd.
2003-09-07 16:22:20 +00:00
itojun c4191f3816 plug memory leak. PR misc/22479 2003-08-14 10:06:36 +00:00
agc 326b2259b7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22366, verified by myself.
2003-08-07 11:25:11 +00:00
itojun 4a1c105c26 ensure string termination 2003-05-17 19:00:22 +00:00
itojun 5be6cd5c8d prevent sscanf overrun 2003-05-17 00:50:36 +00:00
wiz 472351e13d Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
2003-04-16 13:34:34 +00:00
wiz 990562bfef .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
2003-02-25 10:34:36 +00:00
rafal ecf0596577 Convert to use getifaddrs(3) to get interface names; this is mostly removal
of grotty code to unpack data structures returned by the SIOCGIFCONF ioctl.
2002-11-08 03:40:28 +00:00
tv eda273b959 When converting to use getprogname(), please don't forget the necessary
companion call to setprogname() for portability.
2002-03-02 03:45:07 +00:00
pooka 9da6188fe8 re-convert to use getprogname(). This was already once done in rev 1.28,
but silently killed in rev 1.29.

from John Franklin <franklin@elfie.org> in bin/15771
2002-02-28 22:43:42 +00:00
ross 2a76afae02 Generate <>& symbolically. I'm avoiding .../dist/... directories for now. 2002-02-08 01:36:18 +00:00