Browse Source

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@
OPENBSD_4_7
todd 14 years ago
parent
commit
564c480e70
1 changed files with 11 additions and 11 deletions
  1. +11
    -11
      src/etc/netstart

+ 11
- 11
src/etc/netstart View File

@ -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"
;;
*)


Loading…
Cancel
Save