With this, vlan_init.c does not need any special header files anymore
and vlan_ifconfig.c does not need hostapd-specific header files that
might conflict with net/if.h on NetBSD.
Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_printf(MSG_DEBUG, "VLAN: Set interface %s up", if_name);
return ifconfig_helper(if_name, 1);
}
+
+
+int iface_exists(const char *ifname)
+{
+ return if_nametoindex(ifname);
+}
*/
#include "utils/includes.h"
-#include <net/if.h>
-/* Avoid conflicts due to NetBSD net/if.h if_type define with driver.h */
-#undef if_type
#include "utils/common.h"
#include "hostapd.h"
return -1;
}
- if (!if_nametoindex(vlan->ifname))
+ if (!iface_exists(vlan->ifname))
ret = hostapd_vlan_if_add(hapd, vlan->ifname);
else if (!existsok)
return -1;
int ifconfig_helper(const char *if_name, int up);
int ifconfig_up(const char *if_name);
+int iface_exists(const char *ifname);
int vlan_if_remove(struct hostapd_data *hapd, struct hostapd_vlan *vlan);
struct full_dynamic_vlan *