Module Name: src
Committed By: martin
Date: Fri Jun 21 11:05:16 UTC 2024
Modified Files:
src/sys/lib/libsa [netbsd-10]: netif.c
Log Message:
Pull up following revision(s) (requested by rin in ticket #716):
sys/lib/libsa/netif.c: revision 1.27
netif_open: Fail with ENXIO instead of panic if no netif available
Avoid undesirable freeze for efiboot/x86 when interfaces are really
unavailable, or fail to be configured by buggy UEFI firmware.
To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.30.1 src/sys/lib/libsa/netif.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/lib/libsa/netif.c
diff -u src/sys/lib/libsa/netif.c:1.26 src/sys/lib/libsa/netif.c:1.26.30.1
--- src/sys/lib/libsa/netif.c:1.26 Sun Mar 31 20:08:45 2019
+++ src/sys/lib/libsa/netif.c Fri Jun 21 11:05:16 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: netif.c,v 1.26 2019/03/31 20:08:45 christos Exp $ */
+/* $NetBSD: netif.c,v 1.26.30.1 2024/06/21 11:05:16 martin Exp $ */
/*
* Copyright (c) 1993 Adam Glass
@@ -292,8 +292,10 @@ fnd:
(void)memset(s, 0, sizeof(*s));
netif_init();
nif = netif_select(machdep_hint);
- if (!nif)
- panic("netboot: no interfaces left untried");
+ if (!nif) {
+ errno = ENXIO;
+ return -1;
+ }
if (netif_probe(nif, machdep_hint)) {
printf("%s: couldn't probe %s%d\n", __func__,
nif->nif_driver->netif_bname, nif->nif_unit);