diff --git a/ospf6d/ospf6_snmp.c b/ospf6d/ospf6_snmp.c index c148107449a6..a44864596005 100644 --- a/ospf6d/ospf6_snmp.c +++ b/ospf6d/ospf6_snmp.c @@ -914,7 +914,7 @@ static u_char *ospfv3WwLsdbEntry(struct variable *v, oid *name, size_t *length, if (len) id = htonl(*offset); offset += len; - offsetlen -= len; + //offsetlen -= len; // Add back in if we need it again if (exact) { if (v->magic & OSPFv3WWASTABLE) { @@ -1080,8 +1080,8 @@ static u_char *ospfv3IfEntry(struct variable *v, oid *name, size_t *length, len = (offsetlen < 1 ? 0 : 1); if (len) instid = *offset; - offset += len; - offsetlen -= len; + //offset += len; // Add back in if we ever start using again + //offsetlen -= len; if (exact) { oi = ospf6_interface_lookup_by_ifindex(ifindex); @@ -1241,8 +1241,8 @@ static u_char *ospfv3NbrEntry(struct variable *v, oid *name, size_t *length, len = (offsetlen < 1 ? 0 : 1); if (len) rtrid = htonl(*offset); - offset += len; - offsetlen -= len; + //offset += len; // Add back in if we ever start looking at data + //offsetlen -= len; if (exact) { oi = ospf6_interface_lookup_by_ifindex(ifindex); diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c index b2a8a6ff8f14..f02cf7ed31c4 100644 --- a/pimd/pim_iface.c +++ b/pimd/pim_iface.c @@ -205,6 +205,7 @@ struct pim_interface *pim_if_new(struct interface *ifp, int igmp, int pim) if (!pim_ifp->sec_addr_list) { zlog_err("%s: failure: secondary addresslist", __PRETTY_FUNCTION__); + return if_list_clean(pim_ifp); } pim_ifp->sec_addr_list->del = (void (*)(void *))pim_sec_addr_free; pim_ifp->sec_addr_list->cmp = diff --git a/zebra/interface.c b/zebra/interface.c index dd1050ee7f06..18588ee52cfd 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -561,33 +561,35 @@ static void if_delete_connected(struct interface *ifp) struct prefix cp; struct route_node *rn; struct zebra_if *zebra_if; + struct listnode *node; + struct listnode *last = NULL; zebra_if = ifp->info; - if (ifp->connected) { - struct listnode *node; - struct listnode *last = NULL; + if (!ifp->connected) + return; - while ((node = (last ? last->next - : listhead(ifp->connected)))) { - ifc = listgetdata(node); + while ((node = (last ? last->next + : listhead(ifp->connected)))) { + ifc = listgetdata(node); - cp = *CONNECTED_PREFIX(ifc); - apply_mask(&cp); + cp = *CONNECTED_PREFIX(ifc); + apply_mask(&cp); - if (cp.family == AF_INET - && (rn = route_node_lookup(zebra_if->ipv4_subnets, - &cp))) { - struct listnode *anode; - struct listnode *next; - struct listnode *first; - struct list *addr_list; + if (cp.family == AF_INET + && (rn = route_node_lookup(zebra_if->ipv4_subnets, + &cp))) { + struct listnode *anode; + struct listnode *next; + struct listnode *first; + struct list *addr_list; - route_unlock_node(rn); - addr_list = (struct list *)rn->info; + route_unlock_node(rn); + addr_list = (struct list *)rn->info; - /* Remove addresses, secondaries first. */ - first = listhead(addr_list); + /* Remove addresses, secondaries first. */ + first = listhead(addr_list); + if (first) for (anode = first->next; anode || first; anode = next) { if (!anode) { @@ -626,27 +628,26 @@ static void if_delete_connected(struct interface *ifp) last = node; } - /* Free chain list and respective route node. */ - list_delete_and_null(&addr_list); - rn->info = NULL; - route_unlock_node(rn); - } else if (cp.family == AF_INET6) { - connected_down(ifp, ifc); + /* Free chain list and respective route node. */ + list_delete_and_null(&addr_list); + rn->info = NULL; + route_unlock_node(rn); + } else if (cp.family == AF_INET6) { + connected_down(ifp, ifc); - zebra_interface_address_delete_update(ifp, ifc); + zebra_interface_address_delete_update(ifp, ifc); - UNSET_FLAG(ifc->conf, ZEBRA_IFC_REAL); - UNSET_FLAG(ifc->conf, ZEBRA_IFC_QUEUED); + UNSET_FLAG(ifc->conf, ZEBRA_IFC_REAL); + UNSET_FLAG(ifc->conf, ZEBRA_IFC_QUEUED); - if (CHECK_FLAG(ifc->conf, ZEBRA_IFC_CONFIGURED)) - last = node; - else { - listnode_delete(ifp->connected, ifc); - connected_free(ifc); - } - } else { + if (CHECK_FLAG(ifc->conf, ZEBRA_IFC_CONFIGURED)) last = node; + else { + listnode_delete(ifp->connected, ifc); + connected_free(ifc); } + } else { + last = node; } } }