aboutsummaryrefslogtreecommitdiff
path: root/lib/libifconfig/libifconfig_carp.c
Commit message (Collapse)AuthorAgeFilesLines
* carp: support VRRPv3Kristof Provost2024-05-081-0/+6
| | | | | | | | | | Allow carp(4) to use the VRRPv3 protocol (RFC 5798). We can distinguish carp and VRRP based on the protocol version number (carp is 2, VRRPv3 is 3), and support both from the carp(4) code. Reviewed by: glebius Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D44774
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* libifconfig: fix carp key configurationKristof Provost2023-04-301-1/+2
| | | | | | | | | | | | | | | | | | | | 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
* libifconfig: fix incorrect carp outputKristof Provost2023-04-281-0/+2
| | | | | | | | | | | | | | | | | If one interface has a carp address configured on it ifconfig would show this information on all interfaces. That's because the kernel does (as one would expect) not return any carp data for interface without carp configuration. However, this wound up not overwriting the data passed in by the caller, and leaving the (now stale) information in pace. As a result the caller thought carp was configured on the interface. Zero out the input structure before making the call to the kernel, so that we correctly return 0 if there is no carp configuration on the queried interface. Sponsored by: Rubicon Communications, LLC ("Netgate")
* carp: allow commands to use interface name rather than indexKristof Provost2023-03-311-16/+2
| | | | | | | | | | | Get/set commands can now choose to provide the interface name rather than the interface index. This allows userspace to avoid a call to if_nametoindex(). Suggested by: melifaro Reviewed by: melifaro Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D39359
* carp: support unicastKristof Provost2023-03-201-0/+7
| | | | | | | | | | Allow users to configure the address to send carp messages to. This allows carp to be used in unicast mode, which is useful in certain virtual configurations (e.g. AWS, VMWare ESXi, ...) Reviewed by: melifaro Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D38940
* carp: add netlink interfaceKristof Provost2023-03-201-9/+168
| | | | | | | | | Allow carp configuration information to be supplied and retrieved via netlink. Reviewed by: melifaro Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D39048
* libifconfig: multiple feature additionsAlan Somers2018-02-231-0/+60
Added the ability to: * Create virtual interfaces * Create vlan interfaces * Get interface fib * Get interface groups * Get interface status * Get nd6 info * Get media status * Get additional ifaddr info in a convenient struct * Get vhids * Get carp info * Get lagg and laggport status * Iterate over all interfaces and ifaddrs And add more examples, too. Note that this is a backwards-incompatible change. But that's ok, because it's a private library. MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D14463 Notes: svn path=/head/; revision=329853