NIFS is supposed to represent the number of configured interfaces.
authorrpe <rpe@openbsd.org>
Mon, 21 Apr 2014 12:41:36 +0000 (12:41 +0000)
committerrpe <rpe@openbsd.org>
Mon, 21 Apr 2014 12:41:36 +0000 (12:41 +0000)
If an interface got configured twice, NIFS must not be incremented.
So count the number of hostname.if files instead.

discussed with and OK krw@

distrib/miniroot/install.sub

index cb2d6d5..18a3904 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: install.sub,v 1.763 2014/04/20 15:53:57 rpe Exp $
+#      $OpenBSD: install.sub,v 1.764 2014/04/21 12:41:36 rpe Exp $
 #
 # Copyright (c) 1997-2009 Todd Miller, Theo de Raadt, Ken Westerback
 # All rights reserved.
@@ -739,9 +739,10 @@ configure_ifs() {
 
                if [[ -f $_hn ]]; then
                        chmod 640 $_hn
-                       ((NIFS++))
                        : ${_first:=$_ifs}
                fi
+               
+               NIFS=0; for _hn in /tmp/hostname.*; do ((NIFS++)); done
                _p=done
        done
 }