summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrpe <rpe@openbsd.org>2014-04-21 12:41:36 +0000
committerrpe <rpe@openbsd.org>2014-04-21 12:41:36 +0000
commitce8440241e5702a25b8901a5f28ca90cfccc3f8b (patch)
tree10f75efbde798104551b8675179bc4789dde1f0d
parentremove rshd example; ok sthen (diff)
downloadwireguard-openbsd-ce8440241e5702a25b8901a5f28ca90cfccc3f8b.tar.xz
wireguard-openbsd-ce8440241e5702a25b8901a5f28ca90cfccc3f8b.zip
NIFS is supposed to represent the number of configured interfaces.
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@
-rw-r--r--distrib/miniroot/install.sub5
1 files changed, 3 insertions, 2 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index cb2d6d54a5a..18a3904427b 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -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
}