Discussion:
SIOCSIFADDR for AF_INET
(too old to reply)
Manuel Bouyer
2010-03-24 16:55:27 UTC
Permalink
Hi,
while testing agr(4) with a cisco switch, I discovered that agr
relies on SIOCSIFADDR for AF_INET doing something usefull:
ifconfig agr0 agrport epic0 agrport wm0 works, while
ifconfig agr0 agrport wm0 agrport epic0 doens't.
AFAIK only wm(4) does something with SIOCSIFADDR(AF_INET), other
drivers either relies on ether_ioctl() which silently ignores it,
or have their own copy of ether_ioctl() which does the same.
ifconfig can change the link layer address too, and I believe
it works for more than just wm(4).

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 ?
--
Manuel Bouyer <***@antioche.eu.org>
NetBSD: 26 ans d'experience feront toujours la difference
--

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Thor Lancelot Simon
2010-03-24 23:19:22 UTC
Permalink
Post by Manuel Bouyer
Hi,
while testing agr(4) with a cisco switch, I discovered that agr
I don't think you're going to see agr(4) work with a Cisco, at least
not if you want to do LACP. I've never seen the LACP code work with
any non-netbsd peer. :-/

Darran implemented SIOCSIFADDR in wm specifically to get agr working.

Thor

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
David Young
2010-03-25 02:01:44 UTC
Permalink
Post by Manuel Bouyer
Hi,
while testing agr(4) with a cisco switch, I discovered that agr
I think that it relies on SIOCINITIFADDR for AF_LINK to do something
useful?
Post by Manuel Bouyer
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.
Post by Manuel Bouyer
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.

Dave
--
David Young OJC Technologies
***@ojctech.com Urbana, IL * (217) 278-3933

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Manuel Bouyer
2010-03-25 09:02:54 UTC
Permalink
Post by Thor Lancelot Simon
Post by Manuel Bouyer
Hi,
while testing agr(4) with a cisco switch, I discovered that agr
I don't think you're going to see agr(4) work with a Cisco, at least
not if you want to do LACP. I've never seen the LACP code work with
any non-netbsd peer. :-/
It did work with mine (a WS2950), confirmed by counters on the
cisco side, and concurent ttcp tests.
But I had to specify the wm interface last, so that
the SIOCSIFADDR is done on an interface that can handle it.
Post by Thor Lancelot Simon
Darran implemented SIOCSIFADDR in wm specifically to get agr working.
So maybe SIOCSIFADDR should be pushed back to if_ethersubr.c ?
But I wonder if this could be done with the same ioctls as the
ones used by ifconfig. This way code change would be limited to
agr.
--
Manuel Bouyer <***@antioche.eu.org>
NetBSD: 26 ans d'experience feront toujours la difference
--

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Manuel Bouyer
2010-03-25 11:51:27 UTC
Permalink
Post by David Young
Post by Manuel Bouyer
Hi,
while testing agr(4) with a cisco switch, I discovered that agr
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.
Post by David Young
Post by Manuel Bouyer
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.
Post by Manuel Bouyer
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 <***@antioche.eu.org>
NetBSD: 26 ans d'experience feront toujours la difference
--

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
David Young
2010-03-25 20:52:10 UTC
Permalink
Post by Manuel Bouyer
Post by David Young
Post by Manuel Bouyer
Hi,
while testing agr(4) with a cisco switch, I discovered that agr
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.
Are you running NetBSD 5.y.z?

Dave
--
David Young OJC Technologies
***@ojctech.com Urbana, IL * (217) 278-3933

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Manuel Bouyer
2010-03-25 22:11:14 UTC
Permalink
Post by David Young
Post by Manuel Bouyer
Yes, AF_LINK, sorry. But it's really SIOCSIFADDR, not SIOCINITIFADDR.
Are you running NetBSD 5.y.z?
Yes, I did look at the netbsd-5 branch
--
Manuel Bouyer <***@antioche.eu.org>
NetBSD: 26 ans d'experience feront toujours la difference
--

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...