From: kn Date: Sun, 18 Dec 2022 05:51:14 +0000 (+0000) Subject: Do not try to create physical interfaces X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=46f967292a0b002abd8eb15079a35bd0579aa694;p=openbsd Do not try to create physical interfaces vifscreate() always creates all virtual interfaces up-front. To check whether a given interface exists, ifstart() uses ifcreate() which tries to create nonexistent ones. Virtual ones are guaranteed to be present and physical ones cannot be created, so replace the ifcreate() call with a simpler ifconfig test and clarify the comment. OK martijn afresh1 --- diff --git a/etc/netstart b/etc/netstart index eefffc3cdef..71f8885b8e2 100644 --- a/etc/netstart +++ b/etc/netstart @@ -1,6 +1,6 @@ #!/bin/sh - # -# $OpenBSD: netstart,v 1.232 2022/12/16 17:57:39 kn Exp $ +# $OpenBSD: netstart,v 1.233 2022/12/18 05:51:14 kn Exp $ # Turn off Strict Bourne shell mode. set +o sh @@ -173,8 +173,8 @@ ifstart() { chown -LR root:wheel $_hn fi - # Check for ifconfig'able interface, except if -n option is specified. - ifcreate $_if || return + # Skip missing physical interface, virtual ones were created up front. + ifconfig $_if >/dev/null 2>&1 || return # Parse the hostname.if(5) file and fill _cmds array with interface # configuration commands.