1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-04 15:25:38 -08:00

More daemons need the same treatment as ospfd recently got in order to

prevent NULL dereference in interface departure logic when the arrival
of the same interface has not been observed.

Prodded by and ok claudio@
This commit is contained in:
anton 2025-01-02 06:35:57 +00:00
parent a7b8518d79
commit 018a085a0a
3 changed files with 9 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: kroute.c,v 1.14 2017/07/24 11:00:01 friehm Exp $ */
/* $OpenBSD: kroute.c,v 1.15 2025/01/02 06:35:57 anton Exp $ */
/*
* Copyright (c) 2004 Esben Norby <norby@openbsd.org>
@ -269,7 +269,8 @@ if_announce(void *msg)
break;
case IFAN_DEPARTURE:
kif = kif_find(ifan->ifan_index);
kif_remove(kif);
if (kif != NULL)
kif_remove(kif);
break;
}
}

View File

@ -1,4 +1,4 @@
/* $OpenBSD: kroute.c,v 1.69 2024/05/18 11:17:30 jsg Exp $ */
/* $OpenBSD: kroute.c,v 1.70 2025/01/02 06:35:57 anton Exp $ */
/*
* Copyright (c) 2004 Esben Norby <norby@openbsd.org>
@ -1099,7 +1099,8 @@ if_announce(void *msg)
break;
case IFAN_DEPARTURE:
iface = if_find(ifan->ifan_index);
if_del(iface);
if (iface != NULL)
if_del(iface);
break;
}
}

View File

@ -1,4 +1,4 @@
/* $OpenBSD: kroute.c,v 1.36 2023/03/08 04:43:14 guenther Exp $ */
/* $OpenBSD: kroute.c,v 1.37 2025/01/02 06:35:57 anton Exp $ */
/*
* Copyright (c) 2004 Esben Norby <norby@openbsd.org>
@ -710,7 +710,8 @@ if_announce(void *msg)
break;
case IFAN_DEPARTURE:
kif = kif_find(ifan->ifan_index);
kif_remove(kif);
if (kif != NULL)
kif_remove(kif);
break;
}
}