freebsd-dev/lib/libifconfig
Kristof Provost 6a23843a4a libifconfig: fix carp key configuration
There were two issues with the carp key configuration in the new netlink
code.

The first is that userspace failed to actually pass the CARP_NL_KEY
attribute to the kernel, so a key was never set.

The second issue is that snl_attr_get_string() returns a pointer to the
string inside the netlink message. It does not copy the string to the
target buffer. That's somewhat inconvenient to work with in libifconfig
where we have a static buffer for the key.
Introduce snl_attr_copy_string() which can copy a string to a target
buffer and uses the 'arg' parameter to pass the buffer size, so it
doesn't accidentally exceed the available space.

Reviewed by:	melifaro
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D39874
2023-04-30 20:11:54 +02:00
..
libifconfig_bridge.c libifconfig: Add function to get bridge status 2020-07-01 02:32:41 +00:00
libifconfig_carp.c libifconfig: fix carp key configuration 2023-04-30 20:11:54 +02:00
libifconfig_inet6.c
libifconfig_inet.c
libifconfig_internal.c carp: add netlink interface 2023-03-20 10:52:27 +01:00
libifconfig_internal.h carp: add netlink interface 2023-03-20 10:52:27 +01:00
libifconfig_lagg.c
libifconfig_media.c libifconfig: Overhaul ifconfig_media_* interfaces 2021-03-05 04:15:55 -05:00
libifconfig_sfp_tables_internal.tpl.h Move ifconfig SFP status functionality into libifconfig 2020-08-09 16:27:28 +00:00
libifconfig_sfp_tables.tpl.c Move ifconfig SFP status functionality into libifconfig 2020-08-09 16:27:28 +00:00
libifconfig_sfp_tables.tpl.h Move ifconfig SFP status functionality into libifconfig 2020-08-09 16:27:28 +00:00
libifconfig_sfp.c Move ifconfig SFP status functionality into libifconfig 2020-08-09 16:27:28 +00:00
libifconfig_sfp.h Move ifconfig SFP status functionality into libifconfig 2020-08-09 16:27:28 +00:00
libifconfig.c libifconfig: Set error in ifconfig_get_groups 2021-02-27 18:12:23 -05:00
libifconfig.h carp: support unicast 2023-03-20 14:37:09 +01:00
Makefile libifconfig: Overhaul ifconfig_media_* interfaces 2021-03-05 04:15:55 -05:00
Makefile.depend Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
sfp.lua Move ifconfig SFP status functionality into libifconfig 2020-08-09 16:27:28 +00:00
Symbol.map libifconfig: Overhaul ifconfig_media_* interfaces 2021-03-05 04:15:55 -05:00