Subject: Re: Question setting ethernet addresses on an interface
To: Dheeraj Reddy <dheeraj@triveni.no-ip.org>
From: Jaromir Dolecek <jdolecek@NetBSD.org>
List: tech-kern
Date: 07/27/2003 18:06:28
I guess the reason is so that the ioctl would be usable
for setting arbitrary link-layer address. Thus sockaddr_storage.

Cool you work on this, it would be useful to be able to set
the ethernet address from userland.

Note the network device drivers would need to be adjusted
to change the hardware idea of the ethernet address too.
Should be quite easy for most drivers, but it's some
additional work which needs to be done beyond generic
code.

Jaromir

Dheeraj Reddy wrote:
> Hello all.
> 
>   i was trying to write code to set an ethernet address for an interface.
> searched the lists . and got hold of this post.
>   http://www.geocrawler.com/mail/msg.php3?msg_id=6844168&list=465
> 
>   why is it that we need a structure that can hold data as large as 
> sockaddr_storage and not just the regular ifreq since all we need to
> pass is the ethernet address and struct ifreq seems good enough to me ?
>   Jason ??
> 
>   this is how i am doing it..
>   i added the relevant ioctl's in /usr/include/sys/sockio.h and 
> /usr/src/sys/sys/sockio.h , and a procedure in ifconfig.c 
> and a handler 'case' in /usr/src/sys/net/if.c
>   
>    i'm doing this kind of programming for the first time and i want to
> do it correctly. 
> 
> thanks a lot in advance
> 
> truely
> dheeraj
> and a handler in 
> 

-- 
Jaromir Dolecek <jdolecek@NetBSD.org>            http://www.NetBSD.cz/
-=- We should be mindful of the potential goal, but as the tantric    -=-
-=- Buddhist masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow.   Do not let this distract you.''     -=-