]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_attr.c
bgpd: Wrap IPV4_CLASS_DE into ipv4_unicast_valid() helper
[mirror_frr.git] / bgpd / bgp_attr.c
index d57281a70001ce4d07989b4721a7f02408cf89e5..c771616df8fc97c98f5369487c8e944ffec5417c 100644 (file)
@@ -1605,9 +1605,9 @@ enum bgp_attr_parse_ret bgp_attr_nexthop_valid(struct peer *peer,
        in_addr_t nexthop_h;
 
        nexthop_h = ntohl(attr->nexthop.s_addr);
-       if ((IPV4_NET0(nexthop_h) || IPV4_NET127(nexthop_h)
-            || IPV4_CLASS_DE(nexthop_h))
-           && !BGP_DEBUG(allow_martians, ALLOW_MARTIANS)) {
+       if ((IPV4_NET0(nexthop_h) || IPV4_NET127(nexthop_h) ||
+            !ipv4_unicast_valid(&attr->nexthop)) &&
+           !BGP_DEBUG(allow_martians, ALLOW_MARTIANS)) {
                uint8_t data[7]; /* type(2) + length(1) + nhop(4) */
                char buf[INET_ADDRSTRLEN];