]> git.proxmox.com Git - mirror_frr.git/blobdiff - tests/bgpd/test_bgp_table.c
bgpd: fix bgp_table range lookup
[mirror_frr.git] / tests / bgpd / test_bgp_table.c
index 171b1aa22f7957cc8b07e3bacf0f9b59af7c2304..819c2d728269b6e95ee593bf5d2e7cb660aae5c5 100644 (file)
@@ -28,6 +28,8 @@
 #include "bgpd/bgp_table.h"
 #include "linklist.h"
 
+/* Satisfy link requirements from including bgpd.h */
+struct zebra_privs_t bgpd_privs = {0};
 /*
  * test_node_t
  *
@@ -156,7 +158,7 @@ static void test_range_lookup(void)
                                  "1.16.160.0/19", "1.16.32.0/20",
                                  "1.16.32.0/21",  "16.0.0.0/16"};
 
-       int num_prefixes = sizeof(prefixes) / sizeof(prefixes[0]);
+       int num_prefixes = array_size(prefixes);
 
        for (int i = 0; i < num_prefixes; i++)
                add_node(table, prefixes[i]);
@@ -181,7 +183,7 @@ static void test_range_lookup(void)
 
        do_test(table, "16.0.0.0/8", 16, "16.0.0.0/16", NULL);
 
-       do_test(table, "0.0.0.0/3", 21, "1.16.0.0/16", "1.16.128.0/18",
+       do_test(table, "0.0.0.0/2", 21, "1.16.0.0/16", "1.16.128.0/18",
                "1.16.192.0/18", "1.16.64.0/19", "1.16.160.0/19",
                "1.16.32.0/20", "1.16.32.0/21", "16.0.0.0/16", NULL);
 }