anqp: Only register for frames on station interfaces

Check the iftype before registering ANQP on new interface.

Not that the check here and in rrm.c (which already checks the iftype)
may need to be extended to run on NETDEV_WATCH_EVENT_UP because a device
could be created with a different iftype and then have the iftype changed
before powering up.
This commit is contained in:
Andrew Zaborowski 2019-11-20 23:23:41 +01:00 committed by Denis Kenzior
parent aa754cbb4a
commit bc1b9ce10c
1 changed files with 3 additions and 1 deletions

View File

@ -374,7 +374,9 @@ static void anqp_netdev_watch(struct netdev *netdev,
{
switch (event) {
case NETDEV_WATCH_EVENT_NEW:
anqp_register_frame(netdev_get_ifindex(netdev));
if (netdev_get_iftype(netdev) == NETDEV_IFTYPE_STATION)
anqp_register_frame(netdev_get_ifindex(netdev));
return;
default:
break;