tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: SIOCSIFADDR for AF_INET



On Wed, Mar 24, 2010 at 09:01:44PM -0500, David Young wrote:
> On Wed, Mar 24, 2010 at 05:55:27PM +0100, Manuel Bouyer wrote:
> > Hi,
> > while testing agr(4) with a cisco switch, I discovered that agr
> > relies on SIOCSIFADDR for AF_INET doing something usefull:
> 
> I think that it relies on SIOCINITIFADDR for AF_LINK to do something
> useful?

Yes, AF_LINK, sorry. But it's really SIOCSIFADDR, not SIOCINITIFADDR.

> 
> > ifconfig agr0 agrport epic0 agrport wm0  works, while
> > ifconfig agr0 agrport wm0  agrport epic0 doens't.
> 
> As Thor says, Darran hacked wm0 especially to deal with this.
> > What is the correct way of doing this ? ifconfig(4) uses SIOCALIFADDR
> > for this, but this works on a socket not a ifp; can it easily be used from
> > a kernel interface driver ?
> 
> agr(4) should create an AF_LINK socket and use it in a call to
> ifioctl(..., SIOCALIFADDR, ...). It needs to call that in a thread
> context, btw.

We're already in thead context at this point (in the context of the
process doing the SIOCSETAGR ioctl). I'm not sure how to create
a AF_LINK (and destroy it after) though.
I guess at some point, SIOCALIFADDR ends up calling a function with
the ifp as parameter, isn't it ? Can't we enter directly there
from the agr code ?

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index