Date: Fri, 4 Jul 1997 11:17:14 +0300 (EEST) From: Ruslan Ermilov <ru@ferrix.ucb.crimea.ua> To: bde@freebsd.org Cc: freebsd-bugs@freebsd.org Subject: I want to change if_sl.c SC_STATIC behaviour Message-ID: <199707040817.LAA01676@ferrix.ucb.crimea.ua>
next in thread | raw e-mail | index | archive | help
Hi! Sorry for my pure/bad English, my native language is Russian ;-) We've using 2.2.1-RELEASE of FreeBSD now. I have a proposition (or, exactly, I want to discuss) how to enhance if_sl.c to avoid the problem when SC_STATIC flag is used. I'll try to explain the problem: I've configured 4 slip units in the kernel. I need to attach two slip interfaces. And I need to use `static feature' of the driver (using -S # switch of slattach). Well, I run `slattach -s 38400 /dev/cuaa0 -S 1' and what I'm see: 1) netstat -in shows the sl0 and sl1 in reversed order. (this is because `slopen' allocates first free element of slsoftc[], i.e. slsoftc[0], and then, when slattach proceeds the -S1 switch, `sltioctl(SLIOCSUNIT)' assigns to it unit 0 !!!) 2) ifconfig -a show the sl0 and sl1 in normal order. 3) what happens when I try to `ifconfig sl1 x.x.x.x y.y.y.y' is than ifconfig really configures sl0 instead of sl1. (to be more exactly `ifconfig -a' and `netstat -rn' say that sl0 (not sl1) configured). 4) Moreover, when I then kill my slattach process and try to run it again slopen skips slsoftc[0] because it has SC_STATIC flag set. 5) So, when I run and kill slattach four times, slopen return ENXIO. Well, my enhancement to the if_sl.c (already implemented and working) consists of: 1) Do not `attach the given tty to the first available sl unit' when in the slopen. 2) Attach the SPECIFIED sl unit to the tty if the SLIOCSUNIT is invoked. 3) Or atatch `first available sl unit' when the SLIOCGUNIT is invoked. The driver version which I've modified is: $Id: if_sl.c,v 1.45.2.1 1997/03/11 19:40:37 bde Exp $ Thanks in advance, ----------------- Ruslan A. Ermilov System Administrator ru@ucb.crimea.ua United Commercial Bank +380-652-247 647 Simferopol, Crimea
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199707040817.LAA01676>