From: Philippe Guibert Date: Fri, 25 May 2018 10:22:14 +0000 (+0200) Subject: bgpd: attributes presence checked when mpreach is present X-Git-Tag: frr-6.1-dev~395^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=refs%2Fpull%2F2142%2Fhead;p=mirror%2Ffrr.git 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 --- 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)))