Commit ab9668ab57 for frr

commit ab9668ab5727dfd8fc24dece014da7346f81d9ac
Author: Donatas Abraitis <donatas@opensourcerouting.org>
Date:   Wed Dec 2 13:50:27 2026 +0200

    bgpd: Stop OPEN processing if no AFI/SAFI is in common

    When the received MP capabilities do not overlap with the configured
    AFI/SAFIs, bgp_open_option_parse() sends NOTIFICATION(2/7) but returns 0,
    so bgp_open_receive() carries on and returns Receive_OPEN_message as if
    the OPEN was accepted. Any later OPEN check could then queue a second
    NOTIFICATION on the same connection.

    Return -1 as it was done before.

    Fixes: 79cf6512f4adf3a25e78355832aff7b6179d2e30 ("bgpd: Include capabilities when sending NOTIFICATION(7)")
    Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>

diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c
index f9b68984ba..a49edabcf4 100644
--- a/bgpd/bgp_open.c
+++ b/bgpd/bgp_open.c
@@ -1660,6 +1660,7 @@ int bgp_open_option_parse(struct peer_connection *connection, uint16_t length, i
 			bgp_notify_send_with_data(connection, BGP_NOTIFY_OPEN_ERR,
 						  BGP_NOTIFY_OPEN_UNSUP_CAPBL, error_data,
 						  error - error_data);
+			return -1;
 		}
 	}
 	return 0;