]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: set v4 next hop for VPN SAFI for consistency in processing
authorLou Berger <lberger@labn.net>
Sat, 28 Oct 2017 19:04:20 +0000 (15:04 -0400)
committerLou Berger <lberger@labn.net>
Tue, 31 Oct 2017 15:06:17 +0000 (11:06 -0400)
Signed-off-by: Lou Berger <lberger@labn.net>
bgpd/bgp_attr.c

index 2d3158d8471de4d36ae2a4000e61a578a1483e2b..e5f85f73953efcc26b458d22ca30c607e26be7ca 100644 (file)
@@ -1635,6 +1635,10 @@ int bgp_mp_reach_parse(struct bgp_attr_parser_args *args,
 
        /* Nexthop length check. */
        switch (attr->mp_nexthop_len) {
+       case BGP_ATTR_NHLEN_VPNV4:
+               stream_getl(s); /* RD high */
+               stream_getl(s); /* RD low */
+               /* NOTE: intentional fall through - for consistency in rx processing */
        case BGP_ATTR_NHLEN_IPV4:
                stream_get(&attr->mp_nexthop_global_in, s, IPV4_MAX_BYTELEN);
                /* Probably needed for RFC 2283 */
@@ -1642,11 +1646,6 @@ int bgp_mp_reach_parse(struct bgp_attr_parser_args *args,
                        memcpy(&attr->nexthop.s_addr,
                               &attr->mp_nexthop_global_in, IPV4_MAX_BYTELEN);
                break;
-       case BGP_ATTR_NHLEN_VPNV4:
-               stream_getl(s); /* RD high */
-               stream_getl(s); /* RD low */
-               stream_get(&attr->mp_nexthop_global_in, s, IPV4_MAX_BYTELEN);
-               break;
        case BGP_ATTR_NHLEN_IPV6_GLOBAL:
        case BGP_ATTR_NHLEN_VPNV6_GLOBAL:
                if (attr->mp_nexthop_len == BGP_ATTR_NHLEN_VPNV6_GLOBAL) {