]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Do not send notification twice when parsing NLRI labels 12957/head
authorDonatas Abraitis <donatas@opensourcerouting.org>
Sun, 5 Mar 2023 18:56:05 +0000 (20:56 +0200)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Sun, 5 Mar 2023 18:58:26 +0000 (20:58 +0200)
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 <donatas@opensourcerouting.org>
bgpd/bgp_label.c

index c4a5277553ba5243686934f2a3b8e9f28254592f..414dafebd4e5eae0965ed8aaaa105dbda9459781 100644 (file)
@@ -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;
                }