]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: attributes presence checked when mpreach is present 2142/head
authorPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 25 May 2018 10:22:14 +0000 (12:22 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 25 May 2018 13:49:38 +0000 (15:49 +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 276a7054e37ae4007de403875b4f9ca32d191bad..e714e17bde3e3ea269e6de3b8c5147617e4d1882 100644 (file)
@@ -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)))