From 564c480e70c8dff1fab99b67f2c7dbc9a3a972a6 Mon Sep 17 00:00:00 2001 From: todd <> Date: Thu, 10 Dec 2009 00:51:55 +0000 Subject: [PATCH] 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@ --- src/etc/netstart | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/etc/netstart b/src/etc/netstart index 10146254..e0f436a5 100644 --- a/src/etc/netstart +++ b/src/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" ;; *)