diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-06-07 15:28:39 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-06-07 15:29:45 +0200 |
commit | 42e01756c1027d603007d0e33fbdee970c549a6c (patch) | |
tree | 7e3256b7f2f06e861fe14b0bd8407f76548bca05 | |
parent | lib: On some platforms function did not return anything (diff) | |
download | frr-42e01756c1027d603007d0e33fbdee970c549a6c.tar.xz frr-42e01756c1027d603007d0e33fbdee970c549a6c.zip |
pimd: Compiler warning about unset usage
While this is impossible, make the compilers a bit happier
for those of us having to use something old.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com
-rw-r--r-- | pimd/pim_mroute.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c index 866a19fc9..ca0582434 100644 --- a/pimd/pim_mroute.c +++ b/pimd/pim_mroute.c @@ -897,11 +897,11 @@ int pim_mroute_add(struct channel_oil *c_oil, const char *name) int err; int orig = 0; int orig_iif_vif = 0; - struct pim_interface *pim_reg_ifp; - int orig_pimreg_ttl; + struct pim_interface *pim_reg_ifp = NULL; + int orig_pimreg_ttl = 0; bool pimreg_ttl_reset = false; - struct pim_interface *vxlan_ifp; - int orig_term_ttl; + struct pim_interface *vxlan_ifp = NULL; + int orig_term_ttl = 0; bool orig_term_ttl_reset = false; pim->mroute_add_last = pim_time_monotonic_sec(); @@ -985,9 +985,11 @@ int pim_mroute_add(struct channel_oil *c_oil, const char *name) if (c_oil->oil.mfcc_origin.s_addr == INADDR_ANY) c_oil->oil.mfcc_ttls[c_oil->oil.mfcc_parent] = orig; - if (pimreg_ttl_reset) + if (pimreg_ttl_reset) { + assert(pim_reg_ifp); c_oil->oil.mfcc_ttls[pim_reg_ifp->mroute_vif_index] = orig_pimreg_ttl; + } if (orig_term_ttl_reset) c_oil->oil.mfcc_ttls[vxlan_ifp->mroute_vif_index] = |