From 404c82d569a3150eeabce1c6480afdcc58ba97f1 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Fri, 25 May 2018 12:22:14 +0200 Subject: [PATCH] bgpd: attributes presence checked when mpreach is present On the case where an mp_unreach attribute is received, while there is no mp_reach attribute too, it is not necessary to check for missing attributes. Fixes: 67495ddb2e5b ("bgpd: Fixes for recent well-known-attr check patch.") Signed-off-by: Philippe Guibert --- bgpd/bgp_attr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index 276a7054e3..e714e17bde 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -2276,7 +2276,8 @@ static int bgp_attr_check(struct peer *peer, struct attr *attr) are present, it should. Check for any other attribute being present instead. */ - if (attr->flag == ATTR_FLAG_BIT(BGP_ATTR_MP_UNREACH_NLRI)) + if ((!CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_MP_REACH_NLRI)) && + CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_MP_UNREACH_NLRI)))) return BGP_ATTR_PARSE_PROCEED; if (!CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_ORIGIN))) -- 2.39.5