]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: netlink fuzzing path correction
authorMark Stapp <mjs@voltanet.io>
Mon, 6 Aug 2018 20:19:45 +0000 (16:19 -0400)
committerMark Stapp <mjs@voltanet.io>
Thu, 25 Oct 2018 12:34:30 +0000 (08:34 -0400)
Correct use of netlink_parse_info() in the netlink fuzzing path.
Also clarify a couple of comments about pthreads.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
zebra/kernel_netlink.c
zebra/zebra_dplane.c
zebra/zebra_rib.c

index 08219924fbc4bfcdaab65b594c3adb8c4234aba2..0a58c2e2625b7300b9e96c7d073743c59e82f1ca 100644 (file)
@@ -314,11 +314,17 @@ bool netlink_read;
  */
 void netlink_read_init(const char *fname)
 {
+       struct zebra_dplane_info dp_info;
+
        snprintf(netlink_fuzz_file, MAXPATHLEN, "%s", fname);
        /* Creating this fake socket for testing purposes */
        struct zebra_ns *zns = zebra_ns_lookup(NS_DEFAULT);
 
-       netlink_parse_info(netlink_information_fetch, &zns->netlink, zns, 1, 0);
+       /* Capture key info from zns struct */
+       zebra_dplane_info_from_zns(&dp_info, zns, false);
+
+       netlink_parse_info(netlink_information_fetch, &zns->netlink,
+                          &dp_info, 1, 0);
 }
 
 /**
index 8fec9fbce7b14b6520e1eadbedcf440dadb1acd9..7bc623fdf0de456fdd1b79bd4933cda1d8e09a48 100644 (file)
@@ -740,7 +740,7 @@ int dplane_provider_register(const char *name,
        }
 
        if (prio <= DPLANE_PRIO_NONE ||
-           prio >= DPLANE_PRIO_LAST) {
+           prio > DPLANE_PRIO_LAST) {
                ret = EINVAL;
                goto done;
        }
@@ -798,7 +798,9 @@ static void zebra_dplane_init_internal(struct zebra_t *zebra)
 
        /* TODO -- register kernel 'provider' during init */
 
-       /* TODO -- using zebra core event thread temporarily */
+       /* TODO -- start dataplane pthread. We're using the zebra
+        * core/main thread temporarily
+        */
        zdplane_g.dg_master = zebra->master;
 }
 
index b89d2851185911f2473507cc55eadfe7e34ae0ae..964885f47edf42a5b424571cbd89cb6a95187c88 100644 (file)
@@ -3305,7 +3305,7 @@ static int rib_process_dplane_results(struct thread *thread)
 
 /*
  * Results are returned from the dataplane subsystem, in the context of
- * the dataplane thread. We enqueue the results here for processing by
+ * the dataplane pthread. We enqueue the results here for processing by
  * the main thread later.
  */
 static int rib_dplane_results(dplane_ctx_h ctx)