]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Unchecked return value
authorSai Gomathi N <nsaigomathi@vmware.com>
Thu, 27 Oct 2022 08:52:31 +0000 (01:52 -0700)
committerSai Gomathi N <nsaigomathi@vmware.com>
Thu, 27 Oct 2022 10:57:55 +0000 (03:57 -0700)
In tib_sg_oil_setup: Value returned from a function is not checked for errors before being used.
If the function returns an error value, the error value may be mistaken for a normal value.
Here, only the nexthop value is being used. So casted the return type to void.

Coverity CID-1519816

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
pimd/pim_tib.c

index 8f5de3e938dc27a52e6bf94f8379bb686ac412d7..3455e30064d4b32e0d88a15867897c38a6f5412e 100644 (file)
@@ -49,7 +49,8 @@ tib_sg_oil_setup(struct pim_instance *pim, pim_sgaddr sg, struct interface *oif)
        if (up) {
                memcpy(&nexthop, &up->rpf.source_nexthop,
                       sizeof(struct pim_nexthop));
-               pim_ecmp_nexthop_lookup(pim, &nexthop, vif_source, &grp, 0);
+               (void)pim_ecmp_nexthop_lookup(pim, &nexthop, vif_source, &grp,
+                                             0);
                if (nexthop.interface)
                        input_iface_vif_index = pim_if_find_vifindex_by_ifindex(
                                pim, nexthop.interface->ifindex);