From 964d6687dedf5f0775e53b5fd6ff68842459dcf9 Mon Sep 17 00:00:00 2001 From: claudio Date: Tue, 9 Jan 2024 14:43:41 +0000 Subject: [PATCH] rtr_parse_notify() state check is special since we ignore the PDU when it arrives in a strange moment. The RFC is as helpful about this as one could expect. Still I botched the state check and later added an rtr_send_error() call which made the previous worse. OK tb@ --- usr.sbin/bgpd/rtr_proto.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bgpd/rtr_proto.c b/usr.sbin/bgpd/rtr_proto.c index 64cc9e0da9e..f81b143bed6 100644 --- a/usr.sbin/bgpd/rtr_proto.c +++ b/usr.sbin/bgpd/rtr_proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtr_proto.c,v 1.25 2024/01/09 14:15:15 claudio Exp $ */ +/* $OpenBSD: rtr_proto.c,v 1.26 2024/01/09 14:43:41 claudio Exp $ */ /* * Copyright (c) 2020 Claudio Jeker @@ -524,11 +524,10 @@ rtr_parse_notify(struct rtr_session *rs, struct ibuf *pdu) if (rtr_check_session_id(rs, rs->session_id, ¬ify.hdr, pdu) == -1) return -1; - if (rs->state != RTR_STATE_EXCHANGE) { + if (rs->state != RTR_STATE_ESTABLISHED) { log_warnx("rtr %s: received %s: while in state %s (ignored)", log_rtr(rs), log_rtr_type(SERIAL_NOTIFY), rtr_statenames[rs->state]); - rtr_send_error(rs, CORRUPT_DATA, "out of context", pdu); return 0; } -- 2.20.1