aboutsummaryrefslogtreecommitdiffstats
path: root/proto
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2020-11-12 02:37:42 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2020-11-12 02:48:35 +0100
commit99ad208dd73d357156672a53f48b77dcf6515c30 (patch)
treeeedb3e43d509b277c420cf2f6f1ac478b0dcc3d3 /proto
parent9d3fc3062b236f51b2c72a4c2c7b068f1946261d (diff)
downloadbird-99ad208dd73d357156672a53f48b77dcf6515c30.tar.gz
BFD: Fix superfluous reconfiguration of sessions
Diffstat (limited to 'proto')
-rw-r--r--proto/bfd/bfd.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/proto/bfd/bfd.c b/proto/bfd/bfd.c
index 417263ef..a8814382 100644
--- a/proto/bfd/bfd.c
+++ b/proto/bfd/bfd.c
@@ -607,12 +607,20 @@ bfd_free_iface(struct bfd_iface *ifa)
static void
bfd_reconfigure_iface(struct bfd_proto *p, struct bfd_iface *ifa, struct bfd_config *nc)
{
- struct bfd_iface_config *nic = bfd_find_iface_config(nc, ifa->iface);
- ifa->changed = !!memcmp(nic, ifa->cf, sizeof(struct bfd_iface_config));
+ struct bfd_iface_config *new = bfd_find_iface_config(nc, ifa->iface);
+ struct bfd_iface_config *old = ifa->cf;
+
+ /* Check options that are handled in bfd_reconfigure_session() */
+ ifa->changed =
+ (new->min_rx_int != old->min_rx_int) ||
+ (new->min_tx_int != old->min_tx_int) ||
+ (new->idle_tx_int != old->idle_tx_int) ||
+ (new->multiplier != old->multiplier) ||
+ (new->passive != old->passive);
/* This should be probably changed to not access ifa->cf from the BFD thread */
birdloop_enter(p->loop);
- ifa->cf = nic;
+ ifa->cf = new;
birdloop_leave(p->loop);
}