]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd: Fix pim_channel_oil_empty tests
authorDonald Sharp <sharpd@nvidia.com>
Wed, 8 Jun 2022 20:51:48 +0000 (16:51 -0400)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Thu, 9 Jun 2022 17:16:19 +0000 (17:16 +0000)
The pim_channel_oil_empty() function was setting
the pimreg if it ever existed for NULL comparison
but of course the pimreg device is never pulled back
out again when it was needed to be when the pimreg
is not present.

Commit: a5fa982256b23d53d5b833f75224fb7f96054b9b
broke this.

Fixes: #11368
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 30b82c7af79fc167c39c1063c4e269c29e108fe4)

pimd/pim_oil.c

index 5b5cc2c10319cabebd13129426423e93a1bbb780..9434ae07b703496ed52316974234f673b642de4f 100644 (file)
@@ -544,27 +544,19 @@ int pim_channel_add_oif(struct channel_oil *channel_oil, struct interface *oif,
 
 int pim_channel_oil_empty(struct channel_oil *c_oil)
 {
-#if PIM_IPV == 4
-       static struct mfcctl null_oil;
-#else
-       static struct mf6cctl null_oil;
-#endif
+       static struct channel_oil null_oil;
 
        if (!c_oil)
                return 1;
 
-
        /* exclude pimreg from the OIL when checking if the inherited_oil is
         * non-NULL.
         * pimreg device (in all vrfs) uses a vifi of
         * 0 (PIM_OIF_PIM_REGISTER_VIF) so we simply mfcc_ttls[0] */
-       if (oil_if_has(c_oil, 0)) {
-#if PIM_IPV == 4
-               null_oil.mfcc_ttls[0] = 1;
-#else
-               IF_SET(0, &null_oil.mf6cc_ifset);
-#endif
-       }
+       if (oil_if_has(c_oil, 0))
+               oil_if_set(&null_oil, 0, 1);
+       else
+               oil_if_set(&null_oil, 0, 0);
 
-       return !oil_if_cmp(&c_oil->oil, &null_oil);
+       return !oil_if_cmp(&c_oil->oil, &null_oil.oil);
 }