1) addr will never be non-null because of the way we build the cli
at this point in time, but the SA system does not understand this,
add a bread crumb for it.
2) Fix a possible memory leak of the pbr_ifp
3) Fix possible integer overflow when bit shifting.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
memset(&nhop, 0, sizeof(nhop));
nhop.vrf_id = vrf->vrf_id;
+ /*
+ * Make SA happy. CLIPPY is not going to give us a NULL
+ * addr.
+ */
+ assert(addr);
if (addr->sa.sa_family == AF_INET) {
nhop.gate.ipv4.s_addr = addr->sin.sin_addr.s_addr;
if (intf) {
return 0;
}
- return (pbr_ifp);
+ ifp->info = pbr_ifp;
+ return pbr_ifp;
}
/* Inteface addition message from zebra. */
if (!ifp)
return 0;
- if (!ifp->info) {
- struct pbr_interface *pbr_ifp;
-
- pbr_ifp = pbr_if_new(ifp);
- ifp->info = pbr_ifp;
- }
+ if (!ifp->info)
+ pbr_if_new(ifp);
return 0;
}
{
struct pbr_map *pbrm = pbrms->parent;
struct stream *s;
- uint64_t is_installed = 1 << pmi->install_bit;
+ uint64_t is_installed = (uint64_t)1 << pmi->install_bit;
is_installed &= pbrms->installed;