Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Jul 1995 18:35:23 +0200 (MET DST)
From:      J Wunsch <j@uriah.heep.sax.de>
To:        davidg@root.com
Cc:        freebsd-bugs@freefall.cdrom.com
Subject:   Re: kern/577: SLIP requires `ifconfig up' now
Message-ID:  <199507021635.SAA00308@uriah.heep.sax.de>
In-Reply-To: <199507021057.DAA05324@corbin.Root.COM> from "David Greenman" at Jul 2, 95 03:57:55 am

next in thread | previous in thread | raw e-mail | index | archive | help
As David Greenman wrote:
> 
>    I'm confused by this. The code was written to set the interface up whenever
> slattach is run and a tty is attached. Why would you want the interface up if
> this *wasn't* the case?
>    Can you explain your specific problem in more detail? ...I'm not sure I
> agree with your recent fix.

I've used to run the following script as ``configure'' script from
within slattach whenever the connection had been established (or the
slip unit changed, but this is supposed to never happen for me):

#!/bin/sh
#
# called by slattach whenever the slip unit changes
#
# arguments: myname remote netmask "default" old-unit new-unit
#              $1     $2     $3      $4       $5        $6
#
# NB: the old-unit and new-unit arguments are automatically added
# by slattach, the rest has to be supplied to the -r/-u argument
# of slattach

PATH=/sbin:/usr/sbin:/bin:/usr/bin; export PATH

exec 2> /var/log/slip.conf.err

if [ $# != 6 ] ; then
	logger -p user.err "$0: wrong argument count (was $*)"
	exit 2
fi

ifconfig sl$5 down
ifconfig sl$5 delete

ifconfig sl$6 inet $1 $2 netmask $3 || logger -p user.err "$0: ifconfig failed"

if [ "$4" = "default" ] ; then
	if route -rn | grep ^default >/dev/null
	then
		route delete default
	fi
	route add default $2
fi

exit 0


The line ``ifconfig sl$6 ...'' was supposed to set the interface
address and mark the interface automatically `up' (as it's also the
case for other interfaces e.g. ethernet).  After your modification, it
didn't work anymore.  Sticking another ``ifconfig sl$6 up'' in the
next line worked around this, but i thought it's not a good idea to
break with the previous behaviour.

Apparently, the interface isn't marked automatically `up' by slattach.
It works now as one would expect: it's up right after the first
ifconfig, and i can put it down or up later if i want.

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199507021635.SAA00308>