]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: attributes presence checked when mpreach is present 2317/head
authorPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 25 May 2018 10:22:14 +0000 (12:22 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Thu, 31 May 2018 15:44:41 +0000 (17:44 +0200)
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 <philippe.guibert@6wind.com>
bgpd/bgp_attr.c

index b6e9ee3cb233e85730b8dde983e0b96c544982cc..17d090fdac3be9eb6652da0e7afd1aa9d56493ab 100644 (file)
@@ -2240,7 +2240,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)))