opnsense-src/sys/netlink
Alexander V. Chernikov 4e9a97de01 netlink: fix ifconfig P2P inet ADDR ADDR netmask 255.255.255.255 addition
Adding P2P addresses is complex in both ioctl and Netlink.
In the ioctl interface, "broadcast" field is the same field as the
"peer". In is possible to specify non-p2p address for the p2p
 interface in IPv6, but not in IPv4.
In the Netlink interface, "address" field means "peer" address.
As a result, a common notion for the Netlink users is to submit
 same address/peer for non-P2P interfaces.

This change customises mapping the attribute on per-family basis.
Specifically,
for IPv4 - if the interface is P2P, assume "address" is p2p and
 "local" is the address. If the interfase is non-p2p, use "local"
 attribute as the address. If it's not set, use "address" attribute.
for IPv6 - start with "local" attribute as the address. If it's not set,
 use use "address" attribute. If both are set and both are the same,
 assume non p2p, otherwise add as p2p.

MFC after:	2 weeks
Reported by:	jkim
2023-05-31 10:38:38 +00:00
..
route netlink: fix ifconfig P2P inet ADDR ADDR netmask 255.255.255.255 addition 2023-05-31 10:38:38 +00:00
netlink.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
netlink_ctl.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
netlink_debug.h
netlink_domain.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
netlink_generic.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
netlink_generic.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
netlink_generic_kpi.c netlink: reduce default log levels 2023-05-12 14:32:57 +02:00
netlink_glue.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
netlink_io.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
netlink_linux.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
netlink_message_parser.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
netlink_message_parser.h netlink: add an optional post-process hook to the message parsers. 2023-05-15 11:33:10 +00:00
netlink_message_writer.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
netlink_message_writer.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
netlink_module.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
netlink_route.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
netlink_route.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
netlink_snl.h netlink: add snl(3) support for parsing unknown-size arrays 2023-05-27 11:13:14 +00:00
netlink_snl_generic.h netlink: add snl(3) support for listing genetlink multicast groups 2023-05-27 11:13:14 +00:00
netlink_snl_route.h netlink: add IPv4/IPv6 attribute writers using in[6]_addr instead of 2023-05-19 09:45:49 +00:00
netlink_snl_route_compat.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
netlink_snl_route_parsers.h netlink: fix build 2023-05-27 12:29:14 +00:00
netlink_var.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00