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>
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);
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;
}