Subject: setting OSI NSAP address
To: None <netbsd-users@netbsd.org>
From: Takashi Ikeda <taka@ennovatenetworks.com>
List: netbsd-users
Date: 01/10/1999 12:13:42
Hi
Are anyone know about setting OSI-NSAP address on NetBSD?

I tried to set NSAP address with 20 bytes on a interface like this:

my-PC>ifconfig ac0 iso
47.0000.0005.0000.0000.0001.0001.0200.a20c.0b02.00 netmask
0xff.ffff.ffff.ffff.ffff.ffff.ffff.ffff.ffff.ff00.00

but result is like this:

my-PC>ifconfig -a
ac0: flags=a831<UP,POINTOPOINT,NOTRAILERS,SIMPLEX,LINK1,MULTICAST> mtu
9180
        inet 192.168.11.2 --> 192.168.11.3 netmask 0xffffff00
        iso 47.0.0.0.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0  netmask
0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0

-------
Note: ac is ATM interface which is not NetBSD original.  The basic
result is the same when ethernet interface is chosen, and as I described
in below, which network device is chosen seems not to be related to this
issue.
-------
Looking source codes, I know:
1) ifconfig command is using SIOCAIFADDR of ioctl command to set NSAP
address.
2)The function "syscall" in sys/arch/i386/i386/trap.c copies the system
call parameter into kernel buffer on line 646 with "copyin" call, and
dispatches the function.
3)Proceeding if_ioctl function,
and the size of the user buffer (i.e system call parameter) copied is
defined in ioctl command. In case of SIOCAIFADDR, that is the size of
"struct ifaliasreq", but it has not enough size to handle 20byte NSAP or
"struct sockaddr_siso". Therefore I got above result, lower bit of
address and netmask are all null.
I'v confirmed to make new ioctl command with larger size and complete
setting the whole address.

Is this a bug of NetBSD? or did I do something wrong ?

Oh, sorry. I forgot to write my OS information.

I'm using NetBSD 1.3.1 i386-poring. I did some changings including
ATM-NIC driver implementation.

Takashi Ikeda
taka@ennovatenetworks.com