@ -1,6 +1,6 @@
#!/bin/sh -
#!/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)
# Strip comments (and leading/trailing whitespace if IFS is set)
# from a file and spew to stdout
# from a file and spew to stdout
@ -93,11 +93,6 @@ ifstart() {
rtsolif="$rtsolif $if"
rtsolif="$rtsolif $if"
cmd="ifconfig $if $name $mask $bcaddr $ext1 $ext2 up"
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
read dt dtaddr
if [ "$name" = "alias" ]; then
if [ "$name" = "alias" ]; then
@ -120,19 +115,24 @@ ifstart() {
cmd2="$dt $dtaddr"
cmd2="$dt $dtaddr"
;;
;;
esac
esac
if [ ! -n "$name" ]; then
echo "/etc/hostname.$if: invalid network configuration file"
return
fi
case $af in
case $af in
inet)
inet)
if [ ! -n "$name" ]; then
echo "/etc/hostname.$if: inet alone is invalid"
return
fi
[ "$mask" ] && cmd="$cmd netmask $mask"
[ "$mask" ] && cmd="$cmd netmask $mask"
if [ "$bcaddr" -a "X$bcaddr" != "XNONE" ]; then
if [ "$bcaddr" -a "X$bcaddr" != "XNONE" ]; then
cmd="$cmd broadcast $bcaddr"
cmd="$cmd broadcast $bcaddr"
fi
fi
[ "$alias" ] && rtcmd=";route -qn add -host $name 127.0.0.1"
[ "$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"
cmd="$cmd $bcaddr"
;;
;;
*)
*)