History log of /openbsd/usr.sbin/ndp/ndp.c (Results 1 – 25 of 109)
Revision Date Author Comments
# 15967fb2 05-Apr-2023 bluhm <bluhm@openbsd.org>

If ndp -d did not find a neigbor entry, it removed the cloning route
instead. Comparing the arp(8) and ndp(8) code shows that the latter
has a fallthrough to delete. Return an error also in this ca

If ndp -d did not find a neigbor entry, it removed the cloning route
instead. Comparing the arp(8) and ndp(8) code shows that the latter
has a fallthrough to delete. Return an error also in this case.
OK kn@

show more ...


# fba40a11 04-Apr-2023 bluhm <bluhm@openbsd.org>

Remove stylistic differences between arp(8) and ndp(8) delete()
function. This makes it easier to spot real changes in behavior.
OK kn@


# 3a50f0a9 28-Dec-2022 jmc <jmc@openbsd.org>

spelling fixes; from paul tagliamonte
any parts of his diff not taken are noted on tech


# abcde9bc 02-Dec-2022 kn <kn@openbsd.org>

Remove constant basereachable and retrans members from struct nd_ifinfo

Both are initalised with compile-time constants and never written to.

They are part of the Neighbour Discovery machinery and

Remove constant basereachable and retrans members from struct nd_ifinfo

Both are initalised with compile-time constants and never written to.

They are part of the Neighbour Discovery machinery and only surface
through the single-user SIOCGIFINFO_IN6:
$ ndp -i lo0
basereachable=30s0ms, reachable=39s, retrans=1s0ms

These values are read-only since 2017
sys/netinet6/nd6.c r1.217
usr.sbin/ndp/ndp.c r1.85
Remove knob and always do neighbor unreachable detection

Inline the macros (to keep meaningful names), shrink the per-interface
allocated struct nd_ifinfo to what is actually needed and inline
nd6_dad_starttimer()'s constant `msec' argument.

Nothing else in base, incl. regress, uses SIOCGIFINFO_IN6 or `ndp -i'.

OK bluhm

show more ...


# 43abdd53 28-Nov-2022 kn <kn@openbsd.org>

Document struct nd_ifinfo protection, remove obsolete .initialized member

All access to struct ifnet's member *if_nd is read-only, with the one
write exception being nd6_slowtimo() updating ND infor

Document struct nd_ifinfo protection, remove obsolete .initialized member

All access to struct ifnet's member *if_nd is read-only, with the one
write exception being nd6_slowtimo() updating ND information.

IPv6 Neighbour Discovery information is fully protected by the net lock.
---
nd6_ifattach() allocates and unconditionally initialises struct ifnet's
*if_nd member, so early in if_attachsetup() that there is no way to query
unitialised Neighour Unreachable Detection bits.

Only SIOCGIFINFO_IN6 through ndp(8) used the .initialized member:
Added/set since 2002 sys/netinet6/nd6.c r1.42
attach nd_ifinfo structure to if_afdata.
split IPv6 MTU (advertised by RA) from real link MTU.
sync with kame

Read since 2002 usr.sbin/ndp/ndp.c r1.16
use new SIOCGIFINFO_IN6. random other cleanups. sync w/kame.

Obsolete since 2017 sys/netinet6/nd6.c r1.217
usr.sbin/ndp/ndp.c r1.85
Remove knob and always do neighbor unreachable detection.

Feedback OK bluhm

show more ...


# 2150c9ba 09-Nov-2022 kn <kn@openbsd.org>

ndp, route, netstat: adjust ipv6 address width

It has been annoying me for too long that fully specififed GUAs
(2001:0db8:3333:4444:5555:6666:7777:8888) mess up alignment.

systat(1)'s netstat is th

ndp, route, netstat: adjust ipv6 address width

It has been annoying me for too long that fully specififed GUAs
(2001:0db8:3333:4444:5555:6666:7777:8888) mess up alignment.

systat(1)'s netstat is the only view that has a big enough limit and thus
never misaligns.

Unify ndp(8), route(8) and netstat(1) views to always align nicely.

Feedback OK claudio

show more ...


# e80817cd 02-Mar-2021 jsg <jsg@openbsd.org>

remove ts_print() prototype function was removed in rev 1.100


# f775b7d7 24-Jan-2021 florian <florian@openbsd.org>

Pass sockaddr_in6 arround so that we have space to store the scope in
a proper field. Move KAME hack to kernel / userland boundaries.
Due to the way -d (delete) works in ndp(8), once we flip the kern

Pass sockaddr_in6 arround so that we have space to store the scope in
a proper field. Move KAME hack to kernel / userland boundaries.
Due to the way -d (delete) works in ndp(8), once we flip the kernel
over to not pass down embedded scope it also must not expect embeded
scope passed to the kernel.
OK claudio

show more ...


# 3c570657 22-Jan-2021 florian <florian@openbsd.org>

The correct spelling is NULL.


# 567a5b7e 21-Jan-2021 florian <florian@openbsd.org>

ndp only deals with current localtime. Print time with subsecond
resolution in a less roundabout way.
OK phessler, bluhm


# fb5a4c32 19-Dec-2019 bluhm <bluhm@openbsd.org>

In ndp(8) the scope ID was not set correctly so it touches the wrong
route. In parse_host() s6_addr is type u_int8_t, but we have to
write a 16 bit value. Add a cast to fix ndp -c.
reported by Matt

In ndp(8) the scope ID was not set correctly so it touches the wrong
route. In parse_host() s6_addr is type u_int8_t, but we have to
write a 16 bit value. Add a cast to fix ndp -c.
reported by Matthias Pitzl; OK kn@

show more ...


# fd4782b8 31-Aug-2019 bluhm <bluhm@openbsd.org>

The algorithm creating the routing addresses in route(8) and arp(6)
were still not correct. While the values written to the kernel are
fine, the bytes for padding were taken from memory after the so

The algorithm creating the routing addresses in route(8) and arp(6)
were still not correct. While the values written to the kernel are
fine, the bytes for padding were taken from memory after the sockaddr
structs.
In route(8) the union of sockaddrs can be made larger, so that the
padding is taken from there.
In arp(8) the size of the struct is known. Copy only the struct
and advance over the padding. The memory has been zeroed before.
Merge all address size fixes from arp(8) into ndp(8).
OK claudio@

show more ...


# b19e7985 27-Aug-2019 kn <kn@openbsd.org>

Sync const correctness with arp(8)

Zap obsolete linter comments while here.

No object change;
OK bluhm


# e9c45431 25-Aug-2019 kn <kn@openbsd.org>

Merge common parsing route into new parse_host() helper

This chops 18 lines off while unifying the code, now that set(), get()
as well as delete() all parse hostnames and honour -n the same way.

OK

Merge common parsing route into new parse_host() helper

This chops 18 lines off while unifying the code, now that set(), get()
as well as delete() all parse hostnames and honour -n the same way.

OK deraadt

show more ...


# d7bb57e0 23-Aug-2019 kn <kn@openbsd.org>

Honour -n when setting entries

Just like avoiding reverse lookups when printing entries or not resolving
hostnames when deleting entries, make -n effect setting entries as well;
just like pfctl(8)'s

Honour -n when setting entries

Just like avoiding reverse lookups when printing entries or not resolving
hostnames when deleting entries, make -n effect setting entries as well;
just like pfctl(8)'s -N from which the manual wording was copied verbatim.

OK deraadt

show more ...


# 23a16c1c 22-Aug-2019 kn <kn@openbsd.org>

Replace hand-rolled errors with warn(3)

"Looks good" deraadt millert


# df69c215 28-Jun-2019 deraadt <deraadt@openbsd.org>

When system calls indicate an error they return -1, not some arbitrary
value < 0. errno is only updated in this case. Change all (most?)
callers of syscalls to follow this better, and let's see if

When system calls indicate an error they return -1, not some arbitrary
value < 0. errno is only updated in this case. Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.

show more ...


# b47fcd70 22-Jan-2019 krw <krw@openbsd.org>

PF_ROUTE -> AF_ROUTE in the scattered sock()/setsockopt() calls
where the "wrong" #define was used.

ok dlg@


# 1c30f37b 21-Jan-2019 kn <kn@openbsd.org>

Zap unused ntop_buf

Last usage got removed with r1.9 in 2001.

sure deraadt


# e2a0fd57 13-Jul-2018 krw <krw@openbsd.org>

Unused variables.

ok henning@


# e16009e9 17-Jun-2018 benno <benno@openbsd.org>

fix memory leaks: freeaddrinfo() the data from getaddrinfo().
From Thomas Barabosch <thomas DOT barabosch AT fkie DOT fraunhofer DOT de>
Thanks.
ok florian@


# f4147939 26-Apr-2018 guenther <guenther@openbsd.org>

Use <fcntl.h> instead of <sys/file.h> for open() and friends.
Delete a bunch of unnecessary #includes and sort to match style(9)
while doing the above cleanup.

ok deraadt@ krw@


# 8415aa69 25-Oct-2017 mpi <mpi@openbsd.org>

Remove dead code, found by jsg@.

ok jsg@, florian@


# 036cd9ef 09-Aug-2017 jmc <jmc@openbsd.org>

the recent adjustment of -i means usage() fits nicely on
two lines now, instead of three;


# 0e39def2 09-Aug-2017 florian <florian@openbsd.org>

Remove knob and always do neighbor unreachable detection.


12345