Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - SIOCSIFADDR: (8 Items)
   
SIOCSIFADDR  
From some testing that I've done, it appears that SIOCSIFADDR is not supported under io-pkt.  Is this correct?

I was trying to use ioctl(fd,SIOCSIFADDR,foo) to set the mac address of my ethernet interface (my hardware supports this
.. matter of fact demands it in order to keep the MAC addresses unique).

What is the preferred method for accomplishing this (i.e. getting the equivalent of an SIOCSIFADDR down to my driver's 
if_ioctl function)??

Thanks!!

-garyf
RE: SIOCSIFADDR  
Hi Gary:

	Not sure about SIOCSIFADDR and MAC addresses.  I thought this was
for IP addresses and not MAC (could be wrong on that front though. Someone
will correct me if I am :>).

I know that we don't support MAC address changes generically since we
recently had to do this for the Atheros driver and we modified the driver
source to support it.  We used SIOCSIFLLADDR and if you take a look here

http://community.qnx.com/integration/viewcvs/viewcvs.cgi/trunk/sys/dev/ic/at
h.c?root=core_networking&rev=112&system=exsy1001&view=log
(driver changes...  See rev 82)

And here:
http://community.qnx.com/integration/viewcvs/viewcvs.cgi/trunk/sys/dev/doc/s
etmac.c?root=core_networking&rev=83&system=exsy1001&view=log
(example code)

This should do it for you.

	Robert.

-----Original Message-----
From: Gary Faulkner [mailto:gary.faulkner@ucontrol.com] 
Sent: Monday, March 03, 2008 5:30 PM
To: ionetmig-networking
Subject: SIOCSIFADDR

From some testing that I've done, it appears that SIOCSIFADDR is not
supported under io-pkt.  Is this correct?

I was trying to use ioctl(fd,SIOCSIFADDR,foo) to set the mac address of my
ethernet interface (my hardware supports this.. matter of fact demands it in
order to keep the MAC addresses unique).

What is the preferred method for accomplishing this (i.e. getting the
equivalent of an SIOCSIFADDR down to my driver's if_ioctl function)??

Thanks!!

-garyf

_______________________________________________
io-net migration
http://community.qnx.com/sf/go/post5476
Re: RE: SIOCSIFADDR  
Thanks Robert!

Often SIOCSIFADDR is used to set the MAC address when the sockaddr struct passed in is a sockaddr_dl.

But, that should give me what I need!

Thanks!!

-garyf
Re: RE: SIOCSIFADDR  
On Mon, Mar 03, 2008 at 06:14:21PM -0500, Gary Faulkner wrote:
> Thanks Robert!
> 
> Often SIOCSIFADDR is used to set the MAC address when the sockaddr struct passed in is a sockaddr_dl.

I like this idea.  It would make SIOCSIFLLADDR redundant.

-seanb
RE: RE: SIOCSIFADDR  
Would work for me as well if this is "standard practice" since this means
simply adding an extra clause to an already existing ioctl.  Is this
compatible with what netbsd does or would this be an enhancement?

	R.


-----Original Message-----
From: Sean Boudreau [mailto:seanb@qnx.com] 
Sent: Tuesday, March 04, 2008 10:09 AM
To: ionetmig-networking
Subject: Re: RE: SIOCSIFADDR

On Mon, Mar 03, 2008 at 06:14:21PM -0500, Gary Faulkner wrote:
> Thanks Robert!
> 
> Often SIOCSIFADDR is used to set the MAC address when the sockaddr struct
passed in is a sockaddr_dl.

I like this idea.  It would make SIOCSIFLLADDR redundant.

-seanb

_______________________________________________
io-net migration
http://community.qnx.com/sf/go/post5485
Re: RE: SIOCSIFADDR  
There are a couple of minor issues that would need to be
addressed: the union in struct ifreq would need to be padded
out as sizeof(sockaddr_dl) > sizeof(struct sockaddr) and
the link layer ioctl would have to be called from ifioctl()
if AF_LINK was being passed in instead of having it call
in_control() which fails if not AF_INET.

But SIOCSIFLLADDR is already an enhancement :)

-seanb

On Tue, Mar 04, 2008 at 10:40:27AM -0500, Robert Craig wrote:
> Would work for me as well if this is "standard practice" since this means
> simply adding an extra clause to an already existing ioctl.  Is this
> compatible with what netbsd does or would this be an enhancement?
> 
> 	R.
> 
> 
> -----Original Message-----
> From: Sean Boudreau [mailto:seanb@qnx.com] 
> Sent: Tuesday, March 04, 2008 10:09 AM
> To: ionetmig-networking
> Subject: Re: RE: SIOCSIFADDR
> 
> On Mon, Mar 03, 2008 at 06:14:21PM -0500, Gary Faulkner wrote:
> > Thanks Robert!
> > 
> > Often SIOCSIFADDR is used to set the MAC address when the sockaddr struct
> passed in is a sockaddr_dl.
> 
> I like this idea.  It would make SIOCSIFLLADDR redundant.
> 
> -seanb
> 
> _______________________________________________
> io-net migration
> http://community.qnx.com/sf/go/post5485
> 
> _______________________________________________
> io-net migration
> http://community.qnx.com/sf/go/post5486
Re: RE: SIOCSIFADDR  
There's now support in ifconfig for this via the SIOCALIFADDR
ioctl.  SIOCSIFLLADDR is no more:

# ifconfig wm0 link 00:01:02:03:04:05         <- add (don't activate)
# ifconfig wm0 link 00:01:02:03:04:05 active  <- add and activate.
# ifconfig wm0 link 00:01:02:03:04:05 delete  <- delete.

-seanb

On Tue, Mar 04, 2008 at 11:40:27AM -0400, Robert Craig wrote:
> Would work for me as well if this is "standard practice" since this means
> simply adding an extra clause to an already existing ioctl.  Is this
> compatible with what netbsd does or would this be an enhancement?
> 
> 	R.
> 
> 
> -----Original Message-----
> From: Sean Boudreau [mailto:seanb@qnx.com] 
> Sent: Tuesday, March 04, 2008 10:09 AM
> To: ionetmig-networking
> Subject: Re: RE: SIOCSIFADDR
> 
> On Mon, Mar 03, 2008 at 06:14:21PM -0500, Gary Faulkner wrote:
> > Thanks Robert!
> > 
> > Often SIOCSIFADDR is used to set the MAC address when the sockaddr struct
> passed in is a sockaddr_dl.
> 
> I like this idea.  It would make SIOCSIFLLADDR redundant.
> 
> -seanb
> 
> _______________________________________________
> io-net migration
> http://community.qnx.com/sf/go/post5485
> 
> _______________________________________________
> io-net migration
> http://community.qnx.com/sf/go/post5486
Re: RE: SIOCSIFADDR  
As a side note to this, for those of you using the SIOCSIFLLADDR to set the MAC address with the atheros driver, this 
has now been removed in favour of the generic routine.  Note that this requires a complete clean and re-build in order 
to make things work.

  We'll also update the trunk/sys/dev/doc/setmac.c example code as well.
  
  Robert.