determining hostap interfaces from a dev pointer

Matt Brown matt
Tue Oct 4 16:13:14 PDT 2005


Hi, 

I'm working on a patch to correctly update /proc/net/hostap entries when
interfaces created using hostap are renamed. This is especially
important on machines with more than one hostap interface.

I'm using the register_netdevice_notifier function. Which allows me to
setup a function that receives netdev events for *all* interface in the
system. Unfortunately I can't find a way to restrict this to a specific
interface. I also couldn't find a way to get the required notifications
via netlink, hence the use of netdev. 

The problem I am having is that when my notifier function is called it
is passed a void * pointer to a netdev structure. Is there any way,
given an arbitrary dev structure to determine if it is a hostap
interface?

I need to know if the given dev structure is actually a hostap interface
so that I can safely access dev->priv->local. Obviously I don't want to
go messing around with dev->priv for interfaces that are not managed by
the hostap driver!

Does anyone have any ideas for techniques I could use to verify that a
given dev structure is managed by the hostap driver?


Kind Regards

-- 
Matt Brown
matt at mattb.net.nz
Mob +64 275 611 544 www.mattb.net.nz







More information about the Hostap mailing list