History log of /freebsd-current/usr.sbin/arp/arp_netlink.c
Revision Date Author Comments
# 0ad9b235 04-May-2024 Lexi Winter <lexi@le-Fay.ORG>

arp(8): fix a typo in error message for -s/-S

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1214


# 6a3e87e1 20-Feb-2024 Gleb Smirnoff <glebius@FreeBSD.org>

arp: fix arp -s/-S

When setting a permanent ARP entry, the route(4) would use
rtm->rtm_rmx.rmx_expire == 0 as a flag for installing a static entry, but
netlink(4) is looking for explicit NTF_STICKY flag in the request. The
arp(8) utility was adopted to use netlink(4) by default, but it has lots
of route-era guts internally. Specifically there is global variable 'opts'
that shares configuration for both protocols, and it is still initialized
with route(4) specific RTF_xxx flags. In set_nl() these flags are
translated to netlink(4) parameters. However, RTF_STATIC is a flag that is
never set by default, so attempt to use it as a proxy flag manifesting
-s/-S results in losing it. Use zero opts.expire_time as a manifest of
-s/-S operation. This is a minimal fix. A better one would be to fully
get rid of route(4) legacy.

The change also corrects the logic to set NUD_PERMANENT flag for
consistency. This flag is ignored by our kernel (now).

Reviewed by: melifaro, tuexen, emaste
PR: 277063
Fixes: 6ad73dbf65048b0950a1ba6ff25607f6708c8954
Differential Revision: https://reviews.freebsd.org/D43983


# 4f8f43b0 16-Oct-2023 Kristof Provost <kp@FreeBSD.org>

netlink: cope with growing requests

If a request ends up growing beyong the initially allocated space the
netlink functions (such as snl_add_msg_attr_u32()) will allocate a
new buffer. This invalidates the header pointer we can have received
from snl_create_msg_request(). Always use the hdr returned by
snl_finalize_msg().

Reviewed by: melifaro
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D42223


# 79278872 14-Sep-2023 R. Christian McDonald <rcm@rcm.sh>

arp(8): fix by-interface and by-host filtering when using netlink

arp(8) has traditionally supported filtering by interface via -i and
by hostname. However, this functionality was omitted from the initial
netlink-ification of arp. This patch re-introduces this filtering
functionality.

This patch also improves by-interface filtering by storing and using the
ifindex of the requested interface for filtering instead of comparing
interface name strings

Reviewed by: melifaro
Sponsored by: Rubicon Communications, LLC ("Netgate")


# c9090124 27-May-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

netlink: update rta_multipath conditions in arp/ndp after 656a39c1a062


# 2d7842d0 26-Apr-2023 John Baldwin <jhb@FreeBSD.org>

arp/ndp: Use valid prototypes for function declarations with no arguments.


# 52199877 25-Apr-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

arp: report successful deletion via netlink to mimic rtsock.


# 35e7180a 24-Apr-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

arp: remove forgotten debug message.


# 6ad73dbf 25-Apr-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

arp: convert arp(8) to netlink.

The change is intended to be fully transparent to the users.
Similarly to route(8) and netstat(8), arp can be build without
netlink by defining WITHOUT_NETLINK in make.conf.

Differential Revision: https://reviews.freebsd.org/D39720