Skip to content
Snippets Groups Projects
Commit 99872676 authored by Ondřej Zajíček's avatar Ondřej Zajíček
Browse files

BFD: Improve incoming packet matching

For active sessions, ignore received packets with zero local id and
mismatched remote id. That forces a session timeout instead of an
immediate session restart. It makes BFD sessions more resilient to
packet spoofing.

Thanks to André Grüneberg for the suggestion.
parent a8268369
No related branches found
No related tags found
No related merge requests found
Pipeline #109076 passed
......@@ -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 */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment