summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd T. Fries <todd@cvs.openbsd.org>2009-12-10 00:51:56 +0000
committerTodd T. Fries <todd@cvs.openbsd.org>2009-12-10 00:51:56 +0000
commit3951502e815e471b026e326ba14ce3c1b13a0372 (patch)
tree8416fdda5f85893d8709ab63873afe8849ed8eb1
parent1daa03b7cc7aec75d66895a57c34a9b1cec16f1b (diff)
o stop reordering ifconfig arguments (e.g. after 'up ..')
o only stop processing if inet or inet6 lines are malformed o everything not a specially handled bit is passed to ifconfig unmangled noticed by several after the move from bridgename.bridge0 -> hostname.bridge0 prodded by deraadt@, tested by and feedback from several man page bits 'look fine' jmc@
-rw-r--r--etc/netstart22
-rw-r--r--share/man/man5/hostname.if.510
2 files changed, 13 insertions, 19 deletions
diff --git a/etc/netstart b/etc/netstart
index 10146254c2b..e0f436a5b98 100644
--- a/etc/netstart
+++ b/etc/netstart
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $OpenBSD: netstart,v 1.127 2009/11/22 23:09:50 deraadt Exp $
+# $OpenBSD: netstart,v 1.128 2009/12/10 00:51:55 todd Exp $
# Strip comments (and leading/trailing whitespace if IFS is set)
# from a file and spew to stdout
@@ -93,11 +93,6 @@ ifstart() {
rtsolif="$rtsolif $if"
cmd="ifconfig $if $name $mask $bcaddr $ext1 $ext2 up"
;;
- "up")
- # The only one of these guaranteed to be set is $if.
- # The remaining ones exist so that media controls work.
- cmd="ifconfig $if $name $mask $bcaddr $ext1 $ext2 up"
- ;;
*)
read dt dtaddr
if [ "$name" = "alias" ]; then
@@ -120,19 +115,24 @@ ifstart() {
cmd2="$dt $dtaddr"
;;
esac
- if [ ! -n "$name" ]; then
- echo "/etc/hostname.$if: invalid network configuration file"
- return
- fi
case $af in
inet)
+ if [ ! -n "$name" ]; then
+ echo "/etc/hostname.$if: inet alone is invalid"
+ return
+ fi
[ "$mask" ] && cmd="$cmd netmask $mask"
if [ "$bcaddr" -a "X$bcaddr" != "XNONE" ]; then
cmd="$cmd broadcast $bcaddr"
fi
[ "$alias" ] && rtcmd=";route -qn add -host $name 127.0.0.1"
;;
- inet6) [ "$mask" ] && cmd="$cmd prefixlen $mask"
+ inet6)
+ if [ ! -n "$name" ]; then
+ echo "/etc/hostname.$if: inet6 alone is invalid"
+ return
+ fi
+ [ "$mask" ] && cmd="$cmd prefixlen $mask"
cmd="$cmd $bcaddr"
;;
*)
diff --git a/share/man/man5/hostname.if.5 b/share/man/man5/hostname.if.5
index a54cbce1a06..89de6304f76 100644
--- a/share/man/man5/hostname.if.5
+++ b/share/man/man5/hostname.if.5
@@ -1,4 +1,4 @@
-.\" $OpenBSD: hostname.if.5,v 1.53 2009/11/22 22:01:55 deraadt Exp $
+.\" $OpenBSD: hostname.if.5,v 1.54 2009/12/10 00:51:55 todd Exp $
.\" $NetBSD: hosts.5,v 1.4 1994/11/30 19:31:20 jtc Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)hosts.5 8.2 (Berkeley) 12/11/93
.\"
-.Dd $Mdocdate: November 22 2009 $
+.Dd $Mdocdate: December 10 2009 $
.Dt HOSTNAME.IF 5
.Os
.Sh NAME
@@ -275,17 +275,11 @@ and
.Xr pppoe 8 )
consists of
.Bd -ragged -offset indent
-.Va state
.Va options
.Ed
.Pp
The above format has the following field values:
.Bl -tag -width indent -offset indent
-.It Va state
-The administrative state in which to put the interface, either
-.Dq up
-or
-.Dq down .
.It Va options
Miscellaneous options to set on the interface, e.g.,
.Dq media 100baseTX mediaopt full-duplex .