jcs's openbsd hax
openbsd

Fix segfault in ospfd and ospf6d shutdown code

ok phessler

jan e4e377e2 7a953c5f

+18 -18
+9 -9
usr.sbin/ospf6d/ospfe.c
··· 1 - /* $OpenBSD: ospfe.c,v 1.78 2024/11/21 13:38:14 claudio Exp $ */ 1 + /* $OpenBSD: ospfe.c,v 1.79 2025/07/22 18:39:19 jan Exp $ */ 2 2 3 3 /* 4 4 * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> ··· 201 201 struct area *area; 202 202 struct iface *iface; 203 203 204 - /* close pipes */ 205 - imsgbuf_write(&iev_rde->ibuf); 206 - imsgbuf_clear(&iev_rde->ibuf); 207 - close(iev_rde->ibuf.fd); 208 - imsgbuf_write(&iev_main->ibuf); 209 - imsgbuf_clear(&iev_main->ibuf); 210 - close(iev_main->ibuf.fd); 211 - 212 204 /* stop all interfaces and remove all areas */ 213 205 while ((area = LIST_FIRST(&oeconf->area_list)) != NULL) { 214 206 LIST_FOREACH(iface, &area->iface_list, entry) { ··· 222 214 } 223 215 224 216 close(oeconf->ospf_socket); 217 + 218 + /* close pipes */ 219 + imsgbuf_write(&iev_rde->ibuf); 220 + imsgbuf_clear(&iev_rde->ibuf); 221 + close(iev_rde->ibuf.fd); 222 + imsgbuf_write(&iev_main->ibuf); 223 + imsgbuf_clear(&iev_main->ibuf); 224 + close(iev_main->ibuf.fd); 225 225 226 226 /* clean up */ 227 227 free(iev_rde);
+9 -9
usr.sbin/ospfd/ospfe.c
··· 1 - /* $OpenBSD: ospfe.c,v 1.120 2024/11/21 13:38:14 claudio Exp $ */ 1 + /* $OpenBSD: ospfe.c,v 1.121 2025/07/22 18:39:19 jan Exp $ */ 2 2 3 3 /* 4 4 * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> ··· 212 212 struct area *area; 213 213 struct iface *iface; 214 214 215 - /* close pipes */ 216 - imsgbuf_write(&iev_rde->ibuf); 217 - imsgbuf_clear(&iev_rde->ibuf); 218 - close(iev_rde->ibuf.fd); 219 - imsgbuf_write(&iev_main->ibuf); 220 - imsgbuf_clear(&iev_main->ibuf); 221 - close(iev_main->ibuf.fd); 222 - 223 215 /* stop all interfaces and remove all areas */ 224 216 while ((area = LIST_FIRST(&oeconf->area_list)) != NULL) { 225 217 LIST_FOREACH(iface, &area->iface_list, entry) { ··· 234 226 235 227 nbr_del(nbr_find_peerid(NBR_IDSELF)); 236 228 close(oeconf->ospf_socket); 229 + 230 + /* close pipes */ 231 + imsgbuf_write(&iev_rde->ibuf); 232 + imsgbuf_clear(&iev_rde->ibuf); 233 + close(iev_rde->ibuf.fd); 234 + imsgbuf_write(&iev_main->ibuf); 235 + imsgbuf_clear(&iev_main->ibuf); 236 + close(iev_main->ibuf.fd); 237 237 238 238 /* clean up */ 239 239 free(iev_rde);