Before this patch, we always passed `struct attr` for NLRI_UPDATE, but if we
have a situation with treat-as-withdraw (for example: malformed attribute, or
using a command like `neighbor path-attribute treat-as-withdraw`) the route
MUST be withdrawn form the BGP table.
Hence, we MUST pass attr as NULL, in this case we already have this check
under NLRI_ATTR_ARG() macro, just reuse it properly.
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
break;
case NLRI_WITHDRAW:
case NLRI_MP_WITHDRAW:
- nlri_ret = bgp_nlri_parse(peer, &attr, &nlris[i], 1);
+ nlri_ret = bgp_nlri_parse(peer, NLRI_ATTR_ARG,
+ &nlris[i], 1);
break;
default:
nlri_ret = BGP_NLRI_PARSE_ERROR;