mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-09 11:05:04 +00:00
zebra: Remove possible NULL dereference in if_delete_connected
It is technically possible to attempt to use a NULL pointer. Remove this from happening. Additionally cleanup code indentation a small bit. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
9b7e34ec42
commit
070b4959fa
@ -561,12 +561,13 @@ 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)))) {
|
||||
@ -588,6 +589,7 @@ static void if_delete_connected(struct interface *ifp)
|
||||
|
||||
/* Remove addresses, secondaries first. */
|
||||
first = listhead(addr_list);
|
||||
if (first)
|
||||
for (anode = first->next; anode || first;
|
||||
anode = next) {
|
||||
if (!anode) {
|
||||
@ -648,7 +650,6 @@ static void if_delete_connected(struct interface *ifp)
|
||||
last = node;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Handle an interface delete event */
|
||||
|
Loading…
Reference in New Issue
Block a user