Home | History | Annotate | only in /src/usr.sbin/ndp
History log of /src/usr.sbin/ndp
RevisionDateAuthorComments
 1.14 18-Aug-2023  tnn ndp: add gmt2local() from external/bsd/tcpdump instead of reachover

It is no longer shipped with the tcpdump distribution.
 1.13 10-Oct-2017  christos use librumpres
 1.12 14-Dec-2015  ozaki-r Add getaddrinfo.c to RUMPSRCS for link-local addresses
 1.11 01-Sep-2015  ozaki-r Fix rump.ndp -I options by rump-ifying if_nametoindex(3)

From s-yamaguchi@IIJ
 1.10 03-Aug-2015  ozaki-r Introduce rump.ndp

ndp(8) uses RTM that requires that getpid(2) works correctly. Unfortunately
supporting getpid(2) in librumphijack will be tricky so that we rump-ify
ndp(8) as well as arp(8).
 1.9 21-Jun-2013  uwe Don't check MKINET6 - parent makefile doesn't descend to ndp if it's "no".
 1.8 12-Dec-2010  christos branches: 1.8.6; 1.8.12;
use new tcpdump.
 1.7 22-Apr-2009  lukem 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)
 1.6 28-May-2007  tls branches: 1.6.20;
Add new Makefile knob, USE_FORT, which extends USE_SSP by turning on the
FORTIFY_SOURCE feature of libssp, thus checking the size of arguments to
various string and memory copy and set functions (as well as a few system
calls and other miscellany) where known at function entry. RedHat has
evidently built all "core system packages" with this option for some time.

This option should be used at the top of Makefiles (or Makefile.inc where
this is used for subdirectories) but after any setting of LIB.

This is only useful for userland code, and cannot be used in libc or in
any code which includes the libc internals, because it overrides certain
libc functions with macros. Some effort has been made to make USE_FORT=yes
work correctly for a full-system build by having the bsd.sys.mk logic
disable the feature where it should not be used (libc, libssp iteself,
the kernel) but no attempt has been made to build the entire system with
USE_FORT and doing so will doubtless expose numerous bugs and misfeatures.

Adjust the system build so that all programs and libraries that are setuid,
directly handle network data (including serial comm data), perform
authentication, or appear likely to have (or have a history of having)
data-driven bugs (e.g. file(1)) are built with USE_FORT=yes by default,
with the exception of libc, which cannot use USE_FORT and thus uses
only USE_SSP by default. Tested on i386 with no ill results; USE_FORT=no
per-directory or in a system build will disable if desired.
 1.5 13-May-2006  christos Cleanup KNF, WARNS=4.
Phew, this started just to make set() static so that coverity does not get
confused.
 1.4 18-Sep-2002  lukem use NETBSDSRCDIR as appropriate
 1.3 26-Jun-2001  itojun change tcpdump dir to refer to. Daniel Carosone <dan@geek.com.au>
 1.2 03-Jul-1999  itojun s/CFLAGS/CPPFLAGS/ for -D and -I.
 1.1 01-Jul-1999  itojun ndp, "arp"-alike command for IPv6.
 1.6.20.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.8.12.1 23-Jun-2013  tls resync from head
 1.8.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.3 21-Jun-2013  uwe Remove this stub that hasn't been necessary in a decade or so.
 1.2 06-Jul-1999  itojun branches: 1.2.64; 1.2.70;
add NetBSD RCS ID.
 1.1 01-Jul-1999  itojun ndp, "arp"-alike command for IPv6.
 1.2.70.1 23-Jun-2013  tls resync from head
 1.2.64.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.33 19-Sep-2021  andvar fix few more typos in comments, messages and documentation.
 1.32 15-Sep-2020  roy ndp: Show U for Unreachable
 1.31 12-Jun-2020  roy ndp: Sync usage and SYNPOSIS with reality
 1.30 12-Jun-2020  roy Remove in-kernel handling of Router Advertisements

This is much better handled by a user-land tool.
Proposed on tech-net here:
https://mail-index.netbsd.org/tech-net/2020/04/22/msg007766.html

Note that the ioctl SIOCGIFINFO_IN6 no longer sets flags. That now
needs to be done using the pre-existing SIOCSIFINFO_FLAGS ioctl.

Compat is fully provided where it makes sense, but trying to turn on
RA handling will obviously throw an error as it no longer exists.

Note that if you use IPv6 temporary addresses, this now needs to be
turned on in dhcpcd.conf(5) rather than in sysctl.conf(5).
 1.29 14-Feb-2018  wiz Sort some lists. Use EXIT STATUS instead of RETURN VALUES.
 1.28 14-Feb-2018  maxv Use .Cm instead of .Li, same as arp.8.
 1.27 05-Jun-2014  roy Add IPV6CTL_AUTO_LINKLOCAL and ND6_IFF_AUTO_LINKLOCAL toggles which
control the automatic creation of IPv6 link-local addresses when an
interface is brought up.

Taken from FreeBSD.
 1.26 20-Mar-2014  roy branches: 1.26.2;
If IPv6 is disabled for an interface, mark all addresses as tentative.
If enabled, check for a duplicated link-local address and abort enabling
as per RFC 4862, section 5.4.5. If allowed to enable, perform DAD
on the tentative addresses.

Taken from FreeBSD.
 1.25 06-Nov-2009  dyoung branches: 1.25.6; 1.25.12;
Update date.
 1.24 06-Nov-2009  dyoung Teach ndp(8) about override_rtadv.
 1.23 11-Mar-2009  joerg Simplify markup by not using .Xo/.Xc.
 1.22 05-Mar-2006  rpaulo branches: 1.22.28;
NDP-related improvements:
RFC4191
- supports host-side router-preference

RFC3542
- if DAD fails on a interface, disables IPv6 operation on the
interface
- don't advertise MLD report before DAD finishes

Others
- fixes integer overflow for valid and preferred lifetimes
- improves timer granularity for MLD, using callout-timer.
- reflects rtadvd's IPv6 host variable information into kernel
(router only)
- adds a sysctl option to enable/disable pMTUd for multicast
packets
- performs NUD on PPP/GRE interface by default
- Redirect works regardless of ip6_accept_rtadv
- removes RFC1885-related code

From the KAME project via SUZUKI Shinsuke.
Reviewed by core.
 1.21 26-Oct-2004  itojun change description of -I to meet the current implementation. bump date
 1.20 17-Jul-2002  itojun with -i, flag on command line and flag displayed are different, and it does
nothing but confuse users. sync them.

for -nud and such, you need "-- -nud" due to posix arg parsing.

sync w/kame
 1.19 08-Jun-2002  itojun comment out paragraph that does not fit to NetBSD
 1.18 03-Jun-2002  itojun recover backward compatibility in -I behavior. sync w/kame
 1.17 03-Jun-2002  itojun more KNF/nroff. from deraadt via kame
 1.16 03-Jun-2002  itojun more posix-compliant arg parsing. sync with kame. help from deraadt
 1.15 29-May-2002  wiz Drop a space, and two grammar fixes.
 1.14 29-May-2002  itojun use new SIOCGIFINFO_IN6. random other cleanups.
 1.13 08-Feb-2002  ross Generate <>& symbolically. I'm avoiding .../dist/... directories for now.
 1.12 02-Feb-2002  wiz Punctuation nits.
 1.11 03-Apr-2001  wiz Xref tcpdump 8, not 1.
 1.10 08-Feb-2001  itojun sync with latest kame tree. ndp -n -a is prettier with longer addresses.
-l is obsolete (igored).
 1.9 04-Sep-2000  kleink For commands and utilities, use EXIT STATUS rather than RETURN VALUES or
DIAGNOSTICS as appropriate (and documented in mdoc(7)).
 1.8 20-Jun-2000  itojun sync with more recent kame code.
accept scoped address notation.
 1.7 16-Apr-2000  itojun branches: 1.7.4;
perform neighbor unreachability detection on p2p links (spec requires
it for bidir p2p links).
improve -i in ndp(8) to allow tweaking per-interface ND flag on.
fix ndp(8) infinite loop on certain routing table setup.
 1.6 07-Mar-2000  kleink Typo.
 1.5 26-Feb-2000  itojun remove net.inet6.ip6.nd6_proxyall sysctl.
support "ndp -s <ip6> <mac> proxy" for proxy NDP.
 1.4 13-Dec-1999  itojun add -I and -l. cleanup on screen formatting.
(sync with latest KAME)
 1.3 03-Sep-1999  itojun branches: 1.3.4;
fix routing socket alignment issue on alpha.
sync with more recent KAME code.

PR: 8305
 1.2 06-Jul-1999  itojun add NetBSD RCS ID.
 1.1 01-Jul-1999  itojun ndp, "arp"-alike command for IPv6.
 1.3.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.7.4.2 04-Apr-2001  he Pull up revision 1.11 (requested by wiz):
Xref tcpdump 8, not 1.
 1.7.4.1 21-Jun-2000  itojun support scoped address notation.
(pullup from main trunc)
 1.22.28.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.25.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.25.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.26.2.1 10-Aug-2014  tls Rebase.
 1.60 18-Aug-2023  tnn ndp: add gmt2local() from external/bsd/tcpdump instead of reachover

It is no longer shipped with the tcpdump distribution.
 1.59 27-Nov-2021  rillig usr.sbin: remove unnecessary CONSTCOND, lint no longer needs it

Since 2021-01-31, lint no longer requires a CONSTCOND comment in a
do-while-0 statement since this is a common code pattern, especially in
statement-like macros.

sed -i -E 's,} while \(/\* ?CONSTCOND ?\*/ ?0\),} while (0),' */*.[ch]
 1.58 15-Sep-2020  roy ndp: Show U for Unreachable
 1.57 12-Jun-2020  roy ndp: Sync usage and SYNPOSIS with reality
 1.56 12-Jun-2020  roy Remove in-kernel handling of Router Advertisements

This is much better handled by a user-land tool.
Proposed on tech-net here:
https://mail-index.netbsd.org/tech-net/2020/04/22/msg007766.html

Note that the ioctl SIOCGIFINFO_IN6 no longer sets flags. That now
needs to be done using the pre-existing SIOCSIFINFO_FLAGS ioctl.

Compat is fully provided where it makes sense, but trying to turn on
RA handling will obviously throw an error as it no longer exists.

Note that if you use IPv6 temporary addresses, this now needs to be
turned on in dhcpcd.conf(5) rather than in sysctl.conf(5).
 1.55 16-Dec-2018  roy ndp: SIOCSPFXFLUSH_IN6 and SIOCSRTRFLUSH_IN6 expect struct in6_ifreq

And not just a character string of the interface name.
This only worked before because the interface name is the first member
of the structure.
 1.54 12-Jul-2018  nonaka Use s6, not mysin.
 1.53 12-Jul-2018  nonaka ndp(8): host_buf should not be used in delete().

host_buf is passed to the argument host of delete() in do_foreach().
 1.52 12-Jul-2018  nonaka Remove duplicate rtrlist() function prototype.
 1.51 16-Jun-2018  christos branches: 1.51.2;
PR/53371: Thomas Barabosch: Potential memory leak in usr.sbin/ndp/ndp.c
 1.50 28-Jun-2017  ozaki-r branches: 1.50.4;
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
 1.49 26-Jun-2017  ozaki-r 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.
 1.48 19-Sep-2016  christos branches: 1.48.6;
remove unused ancient code and widen v6 address so that columns are aligned.
 1.47 04-Apr-2016  ozaki-r branches: 1.47.2;
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
 1.46 14-Dec-2015  christos Don't forget to set sin_scope. From Ryota Ozaki
 1.45 03-Aug-2015  ozaki-r Introduce rump.ndp

ndp(8) uses RTM that requires that getpid(2) works correctly. Unfortunately
supporting getpid(2) in librumphijack will be tricky so that we rump-ify
ndp(8) as well as arp(8).
 1.44 16-Jun-2015  christos improve error messages (remove \n, use __func__, etc)
 1.43 05-Jun-2014  roy branches: 1.43.2; 1.43.4;
Add IPV6CTL_AUTO_LINKLOCAL and ND6_IFF_AUTO_LINKLOCAL toggles which
control the automatic creation of IPv6 link-local addresses when an
interface is brought up.

Taken from FreeBSD.
 1.42 17-Dec-2013  martin branches: 1.42.2;
Simplify code to print the router/prefix list: use memcpy and local structs
properly aligned on the stack to decode the binary format passed by the
kernel - instead of (bogusly) assuming the format will obey all local
alignement requirements.
 1.41 19-Oct-2013  christos use new scopeid functions
 1.40 31-Aug-2011  joerg branches: 1.40.2; 1.40.4; 1.40.8; 1.40.10; 1.40.16;
Use __dead
 1.39 06-Jun-2011  drochner make this work again after routing socket alignment changes
 1.38 06-Nov-2009  dyoung branches: 1.38.4;
Teach ndp(8) about override_rtadv.
 1.37 16-Jan-2007  hubertf branches: 1.37.18; 1.37.26; 1.37.30;
* Don't include headers twice
* Remove a few trailing whitespaces
* Rearrange and join to one #if for some headers

Patch contributed by Slava Semushin <slava.semushin@gmail.com>
in private mail.
 1.36 22-Oct-2006  christos c99 initializer
 1.35 13-May-2006  christos Cleanup KNF, WARNS=4.
Phew, this started just to make set() static so that coverity does not get
confused.
 1.34 05-Mar-2006  rpaulo NDP-related improvements:
RFC4191
- supports host-side router-preference

RFC3542
- if DAD fails on a interface, disables IPv6 operation on the
interface
- don't advertise MLD report before DAD finishes

Others
- fixes integer overflow for valid and preferred lifetimes
- improves timer granularity for MLD, using callout-timer.
- reflects rtadvd's IPv6 host variable information into kernel
(router only)
- adds a sysctl option to enable/disable pMTUd for multicast
packets
- performs NUD on PPP/GRE interface by default
- Redirect works regardless of ip6_accept_rtadv
- removes RFC1885-related code

From the KAME project via SUZUKI Shinsuke.
Reviewed by core.
 1.33 21-Jan-2006  rpaulo Better support of IPv6 scoped addresses.

- most of the kernel code will not care about the actual encoding of
scope zone IDs and won't touch "s6_addr16[1]" directly.
- similarly, most of the kernel code will not care about link-local
scoped addresses as a special case.
- scope boundary check will be stricter. For example, the current
*BSD code allows a packet with src=::1 and dst=(some global IPv6
address) to be sent outside of the node, if the application do:
s = socket(AF_INET6);
bind(s, "::1");
sendto(s, some_global_IPv6_addr);
This is clearly wrong, since ::1 is only meaningful within a single
node, but the current implementation of the *BSD kernel cannot
reject this attempt.
- and, while there, don't try to remove the ff02::/32 interface route
entry in in6_ifdetach() as it's already gone.

This also includes some level of support for the standard source
address selection algorithm defined in RFC3484, which will be
completed on in the future.

From the KAME project via JINMEI Tatuya.
Approved by core@.
 1.32 24-May-2004  itojun close(2) missing. Andrey Matveev
 1.31 10-Feb-2004  itojun fflush(stdout) on -A. KAME-PR-584
 1.30 08-Jan-2004  itojun typo (struct member name - has to be rtm_addrs). from fujitsu
 1.29 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22366, verified by myself.
 1.28 27-Jun-2003  itojun err() cleanup, from openbsd-current via kame
 1.27 17-May-2003  itojun sscanf overrun
 1.26 17-Jul-2002  itojun with -i, flag on command line and flag displayed are different, and it does
nothing but confuse users. sync them.

for -nud and such, you need "-- -nud" due to posix arg parsing.

sync w/kame
 1.25 03-Jun-2002  itojun recover backward compatibility in -I behavior. sync w/kame
 1.24 03-Jun-2002  itojun more KNF/nroff. from deraadt via kame
 1.23 03-Jun-2002  itojun typo
 1.22 03-Jun-2002  itojun more posix-compliant arg parsing. sync with kame. help from deraadt
 1.21 02-Jun-2002  itojun KNF, from openbsd via kame
 1.20 29-May-2002  itojun more strlcpy. from openbsd via kame
 1.19 29-May-2002  itojun use new SIOCGIFINFO_IN6. random other cleanups.
 1.18 08-Nov-2001  itojun use strncpy() to set ifname arg to ioctl.
 1.17 06-Oct-2001  bjh21 Use getnameinfo() to format link-layer addresses rather than doing it
ourselves.
 1.16 23-Jul-2001  itojun sync with latest kame code. ndp -i won't print info for yet-to-be-initialized
interface.
 1.15 07-May-2001  kleink getopt(3): EOF -> -1.
 1.14 21-Mar-2001  itojun avoid dereferencing null pointer. from kame.
 1.13 08-Feb-2001  itojun sync with latest kame tree. ndp -n -a is prettier with longer addresses.
-l is obsolete (igored).
 1.12 21-Jan-2001  itojun avoid memory leak. sync with kame
 1.11 10-Oct-2000  itojun nuke link-locals correctly on -c. sync with kame
 1.10 04-Jul-2000  matt More #include <stdlib.h> string, etc. cleanup
 1.9 20-Jun-2000  itojun sync with more recent kame code.
accept scoped address notation.
 1.8 16-Apr-2000  itojun branches: 1.8.4;
perform neighbor unreachability detection on p2p links (spec requires
it for bidir p2p links).
improve -i in ndp(8) to allow tweaking per-interface ND flag on.
fix ndp(8) infinite loop on certain routing table setup.
 1.7 14-Apr-2000  simonb Don't declare 'extern opt*' getopt variables.
Don't declare 'extern int h_errno;' - it's in <netdb.h>.
 1.6 26-Feb-2000  itojun remove net.inet6.ip6.nd6_proxyall sysctl.
support "ndp -s <ip6> <mac> proxy" for proxy NDP.
 1.5 22-Jan-2000  tron Remove bogus declaration of "errno".
 1.4 13-Dec-1999  itojun add -I and -l. cleanup on screen formatting.
(sync with latest KAME)
 1.3 03-Sep-1999  itojun branches: 1.3.4;
fix routing socket alignment issue on alpha.
sync with more recent KAME code.

PR: 8305
 1.2 06-Jul-1999  itojun add NetBSD RCS ID.
 1.1 01-Jul-1999  itojun ndp, "arp"-alike command for IPv6.
 1.3.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.8.4.2 17-Oct-2000  tv Pullup 1.11 [itojun]:
nuke link-locals correctly on -c. sync with kame
 1.8.4.1 21-Jun-2000  itojun support scoped address notation.
(pullup from main trunc)
 1.37.30.1 17-Dec-2013  bouyer Pull up following revision(s) (requested by martin in ticket #1892):
usr.sbin/ndp/ndp.c: revision 1.42
sys/netinet6/nd6.c: revision 1.146
Instead of voodo casts use simple byte pointer arithmetic and memcpy to
create the "packed" binary format we pass out to userland when querying
the router/prefix list.
Simplify code to print the router/prefix list: use memcpy and local structs
properly aligned on the stack to decode the binary format passed by the
kernel - instead of (bogusly) assuming the format will obey all local
alignement requirements.
 1.37.26.1 17-Dec-2013  bouyer Pull up following revision(s) (requested by martin in ticket #1892):
usr.sbin/ndp/ndp.c: revision 1.42
sys/netinet6/nd6.c: revision 1.146
Instead of voodo casts use simple byte pointer arithmetic and memcpy to
create the "packed" binary format we pass out to userland when querying
the router/prefix list.
Simplify code to print the router/prefix list: use memcpy and local structs
properly aligned on the stack to decode the binary format passed by the
kernel - instead of (bogusly) assuming the format will obey all local
alignement requirements.
 1.37.18.1 17-Dec-2013  bouyer Pull up following revision(s) (requested by martin in ticket #1892):
usr.sbin/ndp/ndp.c: revision 1.42
sys/netinet6/nd6.c: revision 1.146
Instead of voodo casts use simple byte pointer arithmetic and memcpy to
create the "packed" binary format we pass out to userland when querying
the router/prefix list.
Simplify code to print the router/prefix list: use memcpy and local structs
properly aligned on the stack to decode the binary format passed by the
kernel - instead of (bogusly) assuming the format will obey all local
alignement requirements.
 1.38.4.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.40.16.1 17-Dec-2013  bouyer Pull up following revision(s) (requested by martin in ticket #998):
usr.sbin/ndp/ndp.c: revision 1.42
sys/netinet6/nd6.c: revision 1.146
Instead of voodo casts use simple byte pointer arithmetic and memcpy to
create the "packed" binary format we pass out to userland when querying
the router/prefix list.
Simplify code to print the router/prefix list: use memcpy and local structs
properly aligned on the stack to decode the binary format passed by the
kernel - instead of (bogusly) assuming the format will obey all local
alignement requirements.
 1.40.10.1 17-Dec-2013  bouyer Pull up following revision(s) (requested by martin in ticket #998):
usr.sbin/ndp/ndp.c: revision 1.42
sys/netinet6/nd6.c: revision 1.146
Instead of voodo casts use simple byte pointer arithmetic and memcpy to
create the "packed" binary format we pass out to userland when querying
the router/prefix list.
Simplify code to print the router/prefix list: use memcpy and local structs
properly aligned on the stack to decode the binary format passed by the
kernel - instead of (bogusly) assuming the format will obey all local
alignement requirements.
 1.40.8.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.40.4.1 17-Dec-2013  bouyer Pull up following revision(s) (requested by martin in ticket #998):
usr.sbin/ndp/ndp.c: revision 1.42
sys/netinet6/nd6.c: revision 1.146
Instead of voodo casts use simple byte pointer arithmetic and memcpy to
create the "packed" binary format we pass out to userland when querying
the router/prefix list.
Simplify code to print the router/prefix list: use memcpy and local structs
properly aligned on the stack to decode the binary format passed by the
kernel - instead of (bogusly) assuming the format will obey all local
alignement requirements.
 1.40.2.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.42.2.1 10-Aug-2014  tls Rebase.
 1.43.4.1 26-Jan-2016  riz Pull up following revision(s) (requested by ozaki-r in ticket #1063):
usr.sbin/ndp/ndp.c: revision 1.46
Don't forget to set sin_scope. From Ryota Ozaki
 1.43.2.1 26-Jan-2016  riz Pull up following revision(s) (requested by ozaki-r in ticket #1063):
usr.sbin/ndp/ndp.c: revision 1.46
Don't forget to set sin_scope. From Ryota Ozaki
 1.47.2.1 04-Nov-2016  pgoyette Sync with HEAD
 1.48.6.2 13-Jul-2018  martin Pull up following revision(s) (requested by nonaka in ticket #921):

usr.sbin/ndp/ndp.c: revision 1.52-1.54

Remove duplicate rtrlist() function prototype.

ndp(8): host_buf should not be used in delete().
host_buf is passed to the argument host of delete() in do_foreach().

Use s6, not mysin.
 1.48.6.1 07-Jul-2017  martin Pull up following revision(s) (requested by ozaki-r in ticket #107):
usr.sbin/arp/arp.c: revision 1.56
sys/net/rtsock.c: revision 1.218
sys/net/if_llatbl.c: revision 1.20
usr.sbin/arp/arp.c: revision 1.57
sys/net/rtsock.c: revision 1.219
sys/net/if_llatbl.c: revision 1.21
usr.sbin/arp/arp.c: revision 1.58
tests/net/net_common.sh: revision 1.19
sys/netinet6/nd6.h: revision 1.84
sys/netinet6/nd6.h: revision 1.85
tests/net/arp/t_arp.sh: revision 1.23
sys/netinet6/in6.c: revision 1.246
tests/net/arp/t_arp.sh: revision 1.24
sys/netinet6/in6.c: revision 1.247
tests/net/arp/t_arp.sh: revision 1.25
sys/netinet6/in6.c: revision 1.248
tests/net/arp/t_arp.sh: revision 1.26
usr.sbin/ndp/ndp.c: revision 1.49
tests/net/arp/t_arp.sh: revision 1.27
tests/net/ndp/t_ndp.sh: revision 1.20
tests/net/arp/t_arp.sh: revision 1.28
tests/net/ndp/t_ndp.sh: revision 1.21
tests/net/arp/t_arp.sh: revision 1.29
tests/net/ndp/t_ndp.sh: revision 1.22
tests/net/ndp/t_ndp.sh: revision 1.23
tests/net/route/t_flags6.sh: revision 1.13
tests/net/ndp/t_ndp.sh: revision 1.24
tests/net/route/t_flags6.sh: revision 1.14
tests/net/ndp/t_ndp.sh: revision 1.25
tests/net/route/t_flags6.sh: revision 1.15
tests/net/ndp/t_ndp.sh: revision 1.26
sbin/route/rtutil.c: revision 1.9
tests/net/ndp/t_ndp.sh: revision 1.27
tests/net/ndp/t_ndp.sh: revision 1.28
tests/net/net/t_ipv6address.sh: revision 1.14
tests/net/ndp/t_ra.sh: revision 1.28
tests/net/ndp/t_ndp.sh: revision 1.29
sys/net/route.h: revision 1.113
tests/net/ndp/t_ra.sh: revision 1.29
sys/net/rtsock.c: revision 1.220
sys/net/rtsock.c: revision 1.221
sys/net/rtsock.c: revision 1.222
sys/net/rtsock.c: revision 1.223
tests/net/route/t_route.sh: revision 1.13
sys/net/rtsock.c: revision 1.224
sys/net/route.c: revision 1.196
sys/net/if_llatbl.c: revision 1.19
sys/net/route.c: revision 1.197
sbin/route/route.c: revision 1.156
tests/net/route/t_flags.sh: revision 1.16
tests/net/route/t_flags.sh: revision 1.17
usr.sbin/ndp/ndp.c: revision 1.50
tests/net/route/t_flags.sh: revision 1.18
sys/netinet/in.c: revision 1.204
tests/net/route/t_flags.sh: revision 1.19
sys/netinet/in.c: revision 1.205
tests/net/arp/t_arp.sh: revision 1.30
tests/net/arp/t_arp.sh: revision 1.31
sys/net/if_llatbl.h: revision 1.11
tests/net/arp/t_arp.sh: revision 1.32
sys/net/if_llatbl.h: revision 1.12
tests/net/arp/t_arp.sh: revision 1.33
sys/netinet6/nd6.c: revision 1.233
sys/netinet6/nd6.c: revision 1.234
sys/netinet/if_arp.c: revision 1.251
sys/netinet6/nd6.c: revision 1.235
sys/netinet/if_arp.c: revision 1.252
sbin/route/route.8: revision 1.57
sys/net/rtsock.c: revision 1.214
sys/net/rtsock.c: revision 1.215
sys/net/rtsock.c: revision 1.216
sys/net/rtsock.c: revision 1.217
whitespace police
Simplify
We can assume that rt_ifp is always non-NULL.
Sending a routing message (RTM_ADD) on adding an llentry
A message used to be sent on adding a cloned route. Restore the
behavior for backward compatibility.
Requested by ryo@
Drop RTF_CONNECTED from a result of RTM_GET for ARP/NDP entries
ARP/NDP entries aren't connected routes.
Reported by ryo@
Support -c <count> option for route monitor
route command exits if it receives <count> routing messages where
<count> is a value specified by -c.
The option is useful to get only particular message(s) in a test script.
Test routing messages emitted on operations of ARP/NDP entries
Do netstat -a for an appropriate protocol
Add missing declarations for cleanup
Set net.inet.arp.keep only if it's required
Don't create a permanent L2 cache entry on adding an address to an interface
It was created to copy FreeBSD, however actually the cache isn't
necessary. Remove it to simplify the code and reduce the cost to
maintain it (e.g., keep a consistency with a corresponding local
route).
Fix typo
Fix in_lltable_match_prefix
The function has not been used but will be used soon.
Remove unused function (nd6_rem_ifa_lle)
Allow in6_lltable_free_entry to be called without holding the afdata lock of ifp as well as in_lltable_free_entry
This behavior is a bit odd and should be fixed in the future...
Purge ARP/NDP entries on an interface when the interface is down
Fix PR kern/51179
Purge all related L2 caches on removing a route
The change addresses situations similar to PR 51179.
Purge L2 caches on changing an interface of a route
The change addresses situations similar to PR 51179.
Test implicit removals of ARP/NDP entries
One test case reproudces PR 51179.
Fix build of kernels without both INET and INET6
Tweak lltable_sysctl_dumparp
- Rename lltable_sysctl_dumparp to lltable_sysctl_dump
because it's not only for ARP
- Enable it not only for INET but also for INET6
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.
Improve backward compatibility of (fake) routing messages on adding an ARP/NDP entry
A message originally included only DST and GATEWAY. Restore it.
Fix ifdef; care about a case w/ INET6 and w/o INET
Drop RTF_UP from a routing message of a deleted ARP/NDP entry
Check existence of ARP/NDP entries
Checking ARP/NDP entries is valid rather than checking routes.
Fix wrong comment
Drop RTF_LLINFO flag (now it's RTF_LLDATA) from local routes
They don't have llinfo anymore. And also the change fixes unexpected
behavior of ARP proxy.
Restore ARP/NDP entries to route show and netstat -r
Requested by dyoung@ some time ago
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
Check if ARP/NDP entries are purged when a related route is deleted
 1.50.4.3 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.50.4.2 28-Jul-2018  pgoyette Sync with HEAD
 1.50.4.1 25-Jun-2018  pgoyette Sync with HEAD
 1.51.2.1 10-Jun-2019  christos Sync with HEAD
 1.1 03-Aug-2015  ozaki-r Introduce rump.ndp

ndp(8) uses RTM that requires that getpid(2) works correctly. Unfortunately
supporting getpid(2) in librumphijack will be tricky so that we rump-ify
ndp(8) as well as arp(8).
 1.1 03-Aug-2015  ozaki-r Introduce rump.ndp

ndp(8) uses RTM that requires that getpid(2) works correctly. Unfortunately
supporting getpid(2) in librumphijack will be tricky so that we rump-ify
ndp(8) as well as arp(8).
 1.1 03-Aug-2015  ozaki-r Introduce rump.ndp

ndp(8) uses RTM that requires that getpid(2) works correctly. Unfortunately
supporting getpid(2) in librumphijack will be tricky so that we rump-ify
ndp(8) as well as arp(8).

RSS XML Feed