#
e9255daf |
| 03-Jan-2025 |
Gleb Smirnoff <glebius@FreeBSD.org> |
pf: netlink KPI use cleanup
- use nlf_p_empty instead of declaring own empty array - don't declare _IN() macro when we don't parse a header
Reviewed by: kp Differential Revision: https://reviews.f
pf: netlink KPI use cleanup
- use nlf_p_empty instead of declaring own empty array - don't declare _IN() macro when we don't parse a header
Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D48306
show more ...
|
#
29f61502 |
| 03-Dec-2024 |
Gleb Smirnoff <glebius@FreeBSD.org> |
netlink: use nitems() and roundup(2) from param.h
While here style nested includes (kernel ones go first).
Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D47557
|
Revision tags: release/14.2.0, release/13.4.0 |
|
#
7d508464 |
| 31-Aug-2024 |
Mark Johnston <markj@FreeBSD.org> |
carp: Fix pullup checks
The conditions used to test whether a pullup is needed were inverted.
While here: - Fix a bogus assignment to "iplen": it's already initialized to *offp. - Use in_cksum_skip
carp: Fix pullup checks
The conditions used to test whether a pullup is needed were inverted.
While here: - Fix a bogus assignment to "iplen": it's already initialized to *offp. - Use in_cksum_skip() instead of manually adjusting the data pointer. Otherwise the mbuf is temporarily in an invalid state, since m_len isn't updated to match.
Reported by: KMSAN Reviewed by: kp Sponsored by: Klara, Inc. Fixes: 37115154672f ("carp: support VRRPv3") Differential Revision: https://reviews.freebsd.org/D46492
show more ...
|
Revision tags: release/14.1.0 |
|
#
a254d687 |
| 30-Apr-2024 |
Gleb Smirnoff <glebius@FreeBSD.org> |
carp: isolate VRRP from CARP
There is only one functional change here - we don't allow SIOCSVH (or netlink request) to change sc->sc_version. I'm convinced that allowing such a change doesn't bring
carp: isolate VRRP from CARP
There is only one functional change here - we don't allow SIOCSVH (or netlink request) to change sc->sc_version. I'm convinced that allowing such a change doesn't brings any practical value, but creates enless minefields in front of both developers and end users (sysadmins). If you want to switch from VRRP to CARP or vice versa, you'd need to recreate the VHID.
Oh, one tiny funtional change: carp_ioctl_set() won't modify any fields if it returns EINVAL. Previously you could provide valid advbase with invalid advskew - that used to modify advbase and return EINVAL.
All other changes is a sweep around not ever using CARP fields when we are in VRRP mode and vice versa. Also adding assertions on sc_version where necessary.
Do not send VRRP vars in CARP mode via NetLink and vice versa. However in compat ioctl SIOCGVH for VRRP mode the CARP fields would be zeroes.
This allows to declare softc as union and thus prevent any future logic deterioration wrt to mixing VRRP and CARP.
Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D45039
show more ...
|
#
601438fb |
| 30-Apr-2024 |
Gleb Smirnoff <glebius@FreeBSD.org> |
carp: refactor packet tagging for ether_output()
- Separate HMAC preparation (CARP specific) from tagging. - In unicast mode (CARP specific) don't put tag at all. - Don't put pointer to software con
carp: refactor packet tagging for ether_output()
- Separate HMAC preparation (CARP specific) from tagging. - In unicast mode (CARP specific) don't put tag at all. - Don't put pointer to software context into the tag. Putting just vhid, an integer value, is a safer design.
Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D45038
show more ...
|
#
cda57d95 |
| 30-Apr-2024 |
Gleb Smirnoff <glebius@FreeBSD.org> |
carp: assert that we are calling correct input function. We are.
Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D45037
|
#
5ee92cbd |
| 30-Apr-2024 |
Gleb Smirnoff <glebius@FreeBSD.org> |
carp: don't chain call vrrp_send_ad via carp_send_ad
Provide inline send_ad_locked() that switches between protocol specific sending function.
Rename carp_send_ad() to carp_callout() to avoid getti
carp: don't chain call vrrp_send_ad via carp_send_ad
Provide inline send_ad_locked() that switches between protocol specific sending function.
Rename carp_send_ad() to carp_callout() to avoid getting lost in all these multiple foo_send_ad.
No functional change intended.
Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D45036
show more ...
|
#
37115154 |
| 02-Apr-2024 |
Kristof Provost <kp@FreeBSD.org> |
carp: support VRRPv3
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 ca
carp: support VRRPv3
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
show more ...
|
Revision tags: release/13.3.0 |
|
#
6bce41a3 |
| 27-Feb-2024 |
Gordon Bergling <gbe@FreeBSD.org> |
carp(4): Fix a typo in a source code comment
- s/successfull/successful/
MFC after: 3 days
|
Revision tags: release/14.0.0 |
|
#
ab393e95 |
| 12-Oct-2023 |
Kristof Provost <kp@FreeBSD.org> |
netlink: move NETLINK define to opt_global.h
Move the NETLINK define into opt_global.h so we can rely on it being set correctly, without having to remember to include opt_netlink.h. This ensures tha
netlink: move NETLINK define to opt_global.h
Move the NETLINK define into opt_global.h so we can rely on it being set correctly, without having to remember to include opt_netlink.h. This ensures that the NETLINK define is correctly set. If not we may end up with unloadable modules, due to missing symbols (such as nlmsg_get_group_writer).
PR: 274306 Reviewed by: imp, markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42179
show more ...
|
#
242fa308 |
| 09-Sep-2023 |
Zhenlei Huang <zlei@FreeBSD.org> |
carp: Explicitly mark tunnable net.inet.carp.allow with CTLFLAG_NOFETCH
With recent change 110113bc086f, a vnet tunable can be initialized when there is a corresponding kernel environment variable u
carp: Explicitly mark tunnable net.inet.carp.allow with CTLFLAG_NOFETCH
With recent change 110113bc086f, a vnet tunable can be initialized when there is a corresponding kernel environment variable unless it is marked with the flag CTLFLAG_NOFETCH.
The initialization may happen during early boot(linker preload), at that time vnet0 has not been created. The hander carp_allow_sysctl() for the tunable net.inet.carp.allow requires vnet, thus invoking it during early boot will cause kernel panic.
The tunnable is initialized by vnet sysinit routine ipcarp_sysinit() so let's just mark it with flag CTLFLAG_NOFETCH.
No functional change intended.
Fixes: 110113bc086f sysctl(9): Enable vnet sysctl variables to be loader tunable MFC after: 2 week Differential Revision: https://reviews.freebsd.org/D41525
show more ...
|
#
685dc743 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
#
600bf006 |
| 02-Aug-2023 |
Andrey V. Elsukov <ae@FreeBSD.org> |
carp: delete interface routes on link loss.
Obtained from: Yandex LLC MFC after: 10 days Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D41290
|
#
c2c28c0f |
| 18-May-2023 |
Kristof Provost <kp@FreeBSD.org> |
carp: fix unicast link-local
If the peer6 address is a link-local address we have to embed the scopeid, much like we have to for IPv6 multicast as well.
Sponsored by: Rubicon Communications, LLC ("
carp: fix unicast link-local
If the peer6 address is a link-local address we have to embed the scopeid, much like we have to for IPv6 multicast as well.
Sponsored by: Rubicon Communications, LLC ("Netgate")
show more ...
|
#
4d846d26 |
| 10-May-2023 |
Warner Losh <imp@FreeBSD.org> |
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
show more ...
|
Revision tags: release/13.2.0 |
|
#
28921c4f |
| 31-Mar-2023 |
Kristof Provost <kp@FreeBSD.org> |
carp: allow commands to use interface name rather than index
Get/set commands can now choose to provide the interface name rather than the interface index. This allows userspace to avoid a call to i
carp: allow commands to use interface name rather than index
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
show more ...
|
#
ccff2078 |
| 28-Mar-2023 |
Kristof Provost <kp@FreeBSD.org> |
carp: fix source MAC
When we're not in unicast mode we need to change the source MAC address. The check for this was wrong, because IN_MULTICAST() assumes host endianness and the address in sc_carpa
carp: fix source MAC
When we're not in unicast mode we need to change the source MAC address. The check for this was wrong, because IN_MULTICAST() assumes host endianness and the address in sc_carpaddr is in network endianness.
Sponsored by: Rubicon Communications, LLC ("Netgate")
show more ...
|
#
19e43c16 |
| 27-Mar-2023 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
netlink: add netlink KPI to the kernel by default
This change does the following:
Base Netlink KPIs (ability to register the family, parse and/or write a Netlink message) are always present in the
netlink: add netlink KPI to the kernel by default
This change does the following:
Base Netlink KPIs (ability to register the family, parse and/or write a Netlink message) are always present in the kernel. Specifically, * Implementation of genetlink family/group registration/removal, some base accessors (netlink_generic_kpi.c, 260 LoC) are compiled in unconditionally. * Basic TLV parser functions (netlink_message_parser.c, 507 LoC) are compiled in unconditionally. * Glue functions (netlink<>rtsock), malloc/core sysctl definitions (netlink_glue.c, 259 LoC) are compiled in unconditionally. * The rest of the KPI _functions_ are defined in the netlink_glue.c, but their implementation calls a pointer to either the stub function or the actual function, depending on whether the module is loaded or not.
This approach allows to have only 1k LoC out of ~3.7k LoC (current sys/netlink implementation) in the kernel, which will not grow further. It also allows for the generic netlink kernel customers to load successfully without requiring Netlink module and operate correctly once Netlink module is loaded.
Reviewed by: imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D39269
show more ...
|
#
511a6d5e |
| 20-Mar-2023 |
Kristof Provost <kp@FreeBSD.org> |
carp: use if_name()
Reported by: melifaro Sponsored by: Rubicon Communications, LLC ("Netgate")
|
#
13781800 |
| 15-Mar-2023 |
Kristof Provost <kp@FreeBSD.org> |
carp: support unicast
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
carp: support unicast
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
show more ...
|
#
40e04359 |
| 07-Mar-2023 |
Kristof Provost <kp@FreeBSD.org> |
carp: add netlink interface
Allow carp configuration information to be supplied and retrieved via netlink.
Reviewed by: melifaro Sponsored by: Rubicon Communications, LLC ("Netgate") Differential R
carp: add netlink interface
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
show more ...
|
#
49cad3da |
| 16-Mar-2023 |
Zhenlei Huang <zlei@FreeBSD.org> |
carp: carp_master_down_locked() requires net epoch
Reviewed by: kp Fixes: 1d126e9b9474 carp: Widen epoch coverage MFC after: 1 day Differential Revision: https://reviews.freebsd.org/D39113
|
#
3d0d5b21 |
| 23-Jan-2023 |
Justin Hibbits <jhibbits@FreeBSD.org> |
IfAPI: Explicitly include <net/if_private.h> in netstack
Summary: In preparation of making if_t completely opaque outside of the netstack, explicitly include the header. <net/if_var.h> will stop in
IfAPI: Explicitly include <net/if_private.h> in netstack
Summary: In preparation of making if_t completely opaque outside of the netstack, explicitly include the header. <net/if_var.h> will stop including the header in the future.
Sponsored by: Juniper Networks, Inc. Reviewed by: glebius, melifaro Differential Revision: https://reviews.freebsd.org/D38200
show more ...
|
#
ee49c5d3 |
| 29-Jan-2023 |
Boris Lytochkin <lytboris@gmail.com> |
carp: turn net.inet.carp.allow into a RW tunable
Currently CARP starts announcing its state when initialised, regardless of the state of the other services provided by the server. As a result, the d
carp: turn net.inet.carp.allow into a RW tunable
Currently CARP starts announcing its state when initialised, regardless of the state of the other services provided by the server. As a result, the device can become master while still loading the firewall ruleset or initialising long-starting service.
This change adds the way to request delayed CARP start by setting the net.inet.carp.allow=0 in the loader.conf.
Differential Revision: https://reviews.freebsd.org/D38167 MFC after: 2 weeks
show more ...
|
Revision tags: release/12.4.0 |
|
#
78b1fc05 |
| 17-Aug-2022 |
Gleb Smirnoff <glebius@FreeBSD.org> |
protosw: separate pr_input and pr_ctlinput out of protosw
The protosw KPI historically has implemented two quite orthogonal things: protocols that implement a certain kind of socket, and protocols t
protosw: separate pr_input and pr_ctlinput out of protosw
The protosw KPI historically has implemented two quite orthogonal things: protocols that implement a certain kind of socket, and protocols that are IPv4/IPv6 protocol. These two things do not make one-to-one correspondence. The pr_input and pr_ctlinput methods were utilized only in IP protocols. This strange duality required IP protocols that doesn't have a socket to declare protosw, e.g. carp(4). On the other hand developers of socket protocols thought that they need to define pr_input/pr_ctlinput always, which lead to strange dead code, e.g. div_input() or sdp_ctlinput().
With this change pr_input and pr_ctlinput as part of protosw disappear and IPv4/IPv6 get their private single level protocol switch table ip_protox[] and ip6_protox[] respectively, pointing at array of ipproto_input_t functions. The pr_ctlinput that was used for control input coming from the network (ICMP, ICMPv6) is now represented by ip_ctlprotox[] and ip6_ctlprotox[].
ipproto_register() becomes the only official way to register in the table. Those protocols that were always static and unlikely anybody is interested in making them loadable, are now registered by ip_init(), ip6_init(). An IP protocol that considers itself unloadable shall register itself within its own private SYSINIT().
Reviewed by: tuexen, melifaro Differential revision: https://reviews.freebsd.org/D36157
show more ...
|