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
#!/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
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.