diff options
author | Siger Yang <siger.yang@outlook.com> | 2022-11-25 06:52:46 +0100 |
---|---|---|
committer | Siger Yang <siger.yang@outlook.com> | 2022-11-25 09:21:59 +0100 |
commit | 9f2379bdd2d832370588d3ace1dde591b68cdcaf (patch) | |
tree | 5a2b4f695191d5c699094e5804abd9def438c5a5 /vrrpd/vrrp_northbound.c | |
parent | Merge pull request #12355 from mobash-rasool/pim6-conformance (diff) | |
download | frr-9f2379bdd2d832370588d3ace1dde591b68cdcaf.tar.xz frr-9f2379bdd2d832370588d3ace1dde591b68cdcaf.zip |
vrrpd: add IPv4 pseudoheader option for VRRPv3
This commit adds a new option to control whether a VRRPv3 group
accepts / computes its checksum with a prepended IPv4 pseudoheader.
This should improve interoperability with other devices.
Signed-off-by: Siger Yang <siger.yang@outlook.com>
Diffstat (limited to 'vrrpd/vrrp_northbound.c')
-rw-r--r-- | vrrpd/vrrp_northbound.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/vrrpd/vrrp_northbound.c b/vrrpd/vrrp_northbound.c index d25dc0a19..76d0ad3b1 100644 --- a/vrrpd/vrrp_northbound.c +++ b/vrrpd/vrrp_northbound.c @@ -602,6 +602,26 @@ lib_interface_vrrp_vrrp_group_shutdown_modify(struct nb_cb_modify_args *args) return NB_OK; } +/* + * XPath: /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/checksum-with- + * ipv4-pseudoheader + */ +static int lib_interface_vrrp_vrrp_group_checksum_with_ipv4_pseudoheader_modify( + struct nb_cb_modify_args *args) +{ + if (args->event != NB_EV_APPLY) + return NB_OK; + + struct vrrp_vrouter *vr; + bool checksum_with_ipv4_ph; + + vr = nb_running_get_entry(args->dnode, NULL, true); + checksum_with_ipv4_ph = yang_dnode_get_bool(args->dnode, NULL); + vr->checksum_with_ipv4_pseudoheader = checksum_with_ipv4_ph; + + return NB_OK; +} + /* clang-format off */ const struct frr_yang_module_info frr_vrrpd_info = { .name = "frr-vrrpd", @@ -644,6 +664,13 @@ const struct frr_yang_module_info frr_vrrpd_info = { } }, { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/checksum-with-ipv4-pseudoheader", + .cbs = { + .modify = lib_interface_vrrp_vrrp_group_checksum_with_ipv4_pseudoheader_modify, + .cli_show = cli_show_checksum_with_ipv4_pseudoheader, + } + }, + { .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/advertisement-interval", .cbs = { .modify = lib_interface_vrrp_vrrp_group_advertisement_interval_modify, |