NetBSD and wpa_supplicant v2.5

coypu at SDF.ORG coypu at SDF.ORG
Wed Aug 17 05:09:21 PDT 2016


Hi,

I've built and use wpa_supplicant v2.5 on NetBSD-7.99.35.
It works well, thank you.

Unfortunately, I've had one issue in the build,
NetBSD's <net/if.h> declares a macro:
#define if_type         if_data.ifi_type

This is unfortunate, as wpa_supplicant uses this as a variable name,
leading to a build failure that looks as follows:

../src/drivers/driver.h:3428:64: error: expected ')'
        int (*get_pref_freq_list)(void *priv, enum wpa_driver_if_type if_type,
                                                                      ^
/usr/include/net/if.h:349:25: note: expanded from macro 'if_type'
#define if_type         if_data.ifi_type
                               ^
../src/drivers/driver.h:3428:27: note: to match this '('
        int (*get_pref_freq_list)(void *priv, enum wpa_driver_if_type if_type,
                                 ^
1 error generated.

By using #undef if_type e.g. in common.h I was able to overcome this.

This macro is not a recent addition, and exists in NetBSD 7.0.1 as well.

Perhaps it is possible to implement a change in wpa_supplicant itself,
so future versions will not require #undef to build.

Sorry for the trouble.



More information about the Hostap mailing list