summaryrefslogtreecommitdiff
path: root/proto/bfd/packets.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2023-01-24 09:45:50 +0100
committerMaria Matejka <mq@ucw.cz>2023-01-24 11:04:28 +0100
commit3ac628e0f0b7ffaa49c95688cc95954ece8f61fc (patch)
treeb0678bd2a685dab6eef729232d7ef50a0344abd1 /proto/bfd/packets.c
parent02b2a4ecaaf850ce04b0cd2e74c1ff6fede3f181 (diff)
parent5437104afad90f2a74ce52946f06da607d021e2b (diff)
Merge v2.0.12 into thread-next
Diffstat (limited to 'proto/bfd/packets.c')
-rw-r--r--proto/bfd/packets.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/proto/bfd/packets.c b/proto/bfd/packets.c
index 6f0b4eaf..2200ab09 100644
--- a/proto/bfd/packets.c
+++ b/proto/bfd/packets.c
@@ -374,6 +374,10 @@ bfd_rx_hook(sock *sk, uint len)
/* FIXME: better session matching and message */
if (!s)
return 1;
+
+ /* For active sessions we require matching remote id */
+ if ((s->loc_state == BFD_STATE_UP) && (ntohl(pkt->snd_id) != s->rem_id))
+ DROP("mismatched remote id", ntohl(pkt->snd_id));
}
/* bfd_check_authentication() has its own error logging */