Physical interfaces may at/detach at runtime but ifconfig(8) cannot
create them like virtual ones, yet netstart(8) always tries to do so:

        # sh /etc/netstart -n em0
        { ifconfig em0 || ifconfig em0 create; }
        ifconfig em0 up

vifscreate() is used to create all virtual interfaces up-front and is
always called at the beginning of netstart, whether an explicit list of
interfaces is passed or none, i.e. all are to be configured.

This means we can drop the explicit ifcreate() in ifstart() which
always fails to create physical interfaces and always tries to create
virtual interfaces which were already created.

        # sh ./netstart -n em0
        ifconfig em0 up

Feedback? OK?

Index: netstart
===================================================================
RCS file: /cvs/src/etc/netstart,v
retrieving revision 1.222
diff -u -p -r1.222 netstart
--- netstart    24 Oct 2022 20:51:07 -0000      1.222
+++ netstart    29 Oct 2022 21:27:54 -0000
@@ -152,9 +152,6 @@ ifstart() {
                chown -LR root:wheel $_hn
        fi
 
-       # Check for ifconfig'able interface, except if -n option is specified.
-       ifcreate $_if || return
-
        # Parse the hostname.if(5) file and fill _cmds array with interface
        # configuration commands.
        set -o noglob

Reply via email to