Subject: Re: bin/33923: slattach(8) can't attach sl(4) interface
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
From: Christos Zoulas <christos@zoulas.com>
List: tech-net
Date: 07/08/2006 23:01:56
On Jul 9, 11:57am, tsutsui@ceres.dti.ne.jp (Izumi Tsutsui) wrote:
-- Subject: Re: bin/33923: slattach(8) can't attach sl(4) interface

| christos@zoulas.com wrote:
| 
| > On Jul 8,  7:56pm, cube@cubidou.net (Quentin Garnier) wrote:
| > -- Subject: Re: bin/33923: slattach(8) can't attach sl(4) interface
| > 
| > | By the way, as I have never used sl(4) nor strip(4), I wonder what
| > | clonification changed, beside the fact that the user has to create the
| > | interface by hand.  My reading of slattach.c seems to indicate that
| > | currently (and independently from the fact that sl(4) is clonable) there
| > | is no way to tell for sure which interface it has attached to.
| > | 
| > | Am I correct?
| > | 
| > | [Moved to tech-net because it's not really related to the PR anymore.]
| > 
| > Before cloning we created 2 slip devices and 2 strip devices in the kernel.
| > Now we create none.
| 
| According to sys/net/if_sl.c:slopen() and sys/kern/tty.c:ttioctl()
| (which just calls slopen() vir struct linesw), slopen() just
| looks up all sl interfaces (by list or array) and uses the first
| available one.
| 
| There is no way to pass/return an unit number via struct linesw without
| API changes?

Yes, and it should allocate one if one is not available, the same way ppp
does. There is a way to attach to a specific unit (again look at the ppp code).

christos