From: Donatas Abraitis Date: Sun, 5 Mar 2023 18:56:05 +0000 (+0200) Subject: bgpd: Do not send notification twice when parsing NLRI labels X-Git-Tag: base_9.0~325^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=refs%2Fpull%2F12957%2Fhead;p=mirror%2Ffrr.git bgpd: Do not send notification twice when parsing NLRI labels This is already handled in bgp_nlri_parse() by checking error code. Even more, we should send error sub-code to be according the NLRI type. If it's MP_UPDATE/MP_WITHDRAW, sub-code should be an Optional Attribute error. Signed-off-by: Donatas Abraitis --- diff --git a/bgpd/bgp_label.c b/bgpd/bgp_label.c index c4a5277553..414dafebd4 100644 --- a/bgpd/bgp_label.c +++ b/bgpd/bgp_label.c @@ -388,8 +388,6 @@ int bgp_nlri_parse_label(struct peer *peer, struct attr *attr, EC_BGP_UPDATE_RCV, "%s [Error] Update packet error (wrong label length 0)", peer->host); - bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR, - BGP_NOTIFY_UPDATE_INVAL_NETWORK); return BGP_NLRI_PARSE_ERROR_LABEL_LENGTH; } p.prefixlen = prefixlen - BSIZE(llen); @@ -399,8 +397,6 @@ int bgp_nlri_parse_label(struct peer *peer, struct attr *attr, flog_err(EC_BGP_UPDATE_RCV, "%s [Error] Update packet error (wrong label length %d)", peer->host, prefixlen); - bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR, - BGP_NOTIFY_UPDATE_INVAL_NETWORK); return BGP_NLRI_PARSE_ERROR_LABEL_LENGTH; }