diff options
author | Anuradha Karuppiah <anuradhak@cumulusnetworks.com> | 2019-11-15 20:42:32 +0100 |
---|---|---|
committer | Anuradha Karuppiah <anuradhak@cumulusnetworks.com> | 2019-11-15 23:16:08 +0100 |
commit | d86632fba3fb2839edfefc5e67b929040c73fc61 (patch) | |
tree | ae324dffcb426841dc4132f09ee1e49ceed96afa /pimd/pim_oil.c | |
parent | pimd: handle RPF resolution while in joined state (diff) | |
download | frr-d86632fba3fb2839edfefc5e67b929040c73fc61.tar.xz frr-d86632fba3fb2839edfefc5e67b929040c73fc61.zip |
pimd: fixup pim_channel_oil_empty macro
The macro was always returning non-empty because of comparing an
array of u8_t with an array of u32_t.
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_oil.c')
-rw-r--r-- | pimd/pim_oil.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/pimd/pim_oil.c b/pimd/pim_oil.c index 979bc669f..ed4ef6e70 100644 --- a/pimd/pim_oil.c +++ b/pimd/pim_oil.c @@ -646,19 +646,11 @@ int pim_channel_add_oif(struct channel_oil *channel_oil, struct interface *oif, int pim_channel_oil_empty(struct channel_oil *c_oil) { - static uint32_t zero[MAXVIFS]; - static int inited = 0; + static struct mfcctl null_oil; if (!c_oil) return 1; - /* - * Not sure that this is necessary, but I would rather ensure - * that this works. - */ - if (!inited) { - memset(&zero, 0, sizeof(uint32_t) * MAXVIFS); - inited = 1; - } - return !memcmp(c_oil->oil.mfcc_ttls, zero, MAXVIFS * sizeof(uint32_t)); + return !memcmp(c_oil->oil.mfcc_ttls, + null_oil.mfcc_ttls, sizeof(null_oil.mfcc_ttls)); } |