=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/etc/netstart,v retrieving revision 1.83 retrieving revision 1.84 diff -c -r1.83 -r1.84 *** src/etc/netstart 2002/02/21 02:32:01 1.83 --- src/etc/netstart 2002/02/23 01:55:24 1.84 *************** *** 1,6 **** #!/bin/sh - # ! # $OpenBSD: netstart,v 1.83 2002/02/21 02:32:01 miod Exp $ # Returns true if $1 contains only alphanumerics isalphanumeric() { --- 1,6 ---- #!/bin/sh - # ! # $OpenBSD: netstart,v 1.84 2002/02/23 01:55:24 deraadt Exp $ # Returns true if $1 contains only alphanumerics isalphanumeric() { *************** *** 18,30 **** # Start the $1 interface ifstart() { # Interface names must be alphanumeric only. We check to avoid # configuring backup or temp files, and to catch the "*" case. ! if ! isalphanumeric "$1"; then return fi ! ifconfig $1 > /dev/null 2>&1 if [ "$?" != "0" ]; then return fi --- 18,31 ---- # Start the $1 interface ifstart() { + if=$1 # Interface names must be alphanumeric only. We check to avoid # configuring backup or temp files, and to catch the "*" case. ! if ! isalphanumeric "$if"; then return fi ! ifconfig $if > /dev/null 2>&1 if [ "$?" != "0" ]; then return fi *************** *** 55,78 **** cmd="${af#*!} ${name} ${mask} ${bcaddr} ${ext1} ${ext2}" ;; "bridge") ! cmd="echo /etc/hostname.$1: bridges now supported via bridgename.* files" ;; "dhcp") [ "$name" = "NONE" ] && name= [ "$mask" = "NONE" ] && mask= [ "$bcaddr" = "NONE" ] && bcaddr= ! ifconfig $1 $name $mask $bcaddr $ext1 $ext2 down ! cmd="dhclient $1" ;; "rtsol") ! ifconfig $1 $name $mask $bcaddr $ext1 $ext2 up ! rtsolif="$rtsolif $1" cmd= ;; "up") ! # The only one of these guaranteed to be set is $1. # The remaining ones exist so that media controls work. ! cmd="ifconfig $1 $name $mask $bcaddr $ext1 $ext2 up" ;; *) read dt dtaddr --- 56,79 ---- cmd="${af#*!} ${name} ${mask} ${bcaddr} ${ext1} ${ext2}" ;; "bridge") ! cmd="echo /etc/hostname.$if: bridges now supported via bridgename.* files" ;; "dhcp") [ "$name" = "NONE" ] && name= [ "$mask" = "NONE" ] && mask= [ "$bcaddr" = "NONE" ] && bcaddr= ! ifconfig $if $name $mask $bcaddr $ext1 $ext2 down ! cmd="dhclient $if" ;; "rtsol") ! ifconfig $if $name $mask $bcaddr $ext1 $ext2 up ! rtsolif="$rtsolif $if" cmd= ;; "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 *************** *** 87,93 **** else alias= fi ! cmd="ifconfig $1 $af $alias $name " case "$dt" in dest) cmd="$cmd $dtaddr" --- 88,94 ---- else alias= fi ! cmd="ifconfig $if $af $alias $name " case "$dt" in dest) cmd="$cmd $dtaddr" *************** *** 97,103 **** ;; esac if [ ! -n "$name" ]; then ! echo "/etc/hostname.$1: invalid network configuration file" return fi case $af in --- 98,104 ---- ;; esac if [ ! -n "$name" ]; then ! echo "/etc/hostname.$if: invalid network configuration file" return fi case $af in *************** *** 119,125 **** ;; esac eval "$cmd" ! done < /etc/hostname.$1 } # Start the $1 bridge --- 120,126 ---- ;; esac eval "$cmd" ! done < /etc/hostname.$if } # Start the $1 bridge