From e706d2d30d37fd8626969a1df2adc73059f4ab35 Mon Sep 17 00:00:00 2001 From: Masashi Honma Date: Tue, 26 Nov 2013 11:43:37 +0900 Subject: [PATCH] bsd: Fix compilation error for NetBSD Commit 5dd82c634cb5e24500ac4d1374f806fb37dd88bb causes compilation error on NetBSD 6.1.2. Fix compilation with #ifdef blocks. Signed-hostap: Masashi Honma --- src/drivers/driver_bsd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/drivers/driver_bsd.c b/src/drivers/driver_bsd.c index 45d6b191c..fb6402da5 100644 --- a/src/drivers/driver_bsd.c +++ b/src/drivers/driver_bsd.c @@ -85,8 +85,10 @@ get80211opmode(struct bsd_driver_data *drv) return IEEE80211_M_HOSTAP; if (ifmr.ifm_current & IFM_IEEE80211_MONITOR) return IEEE80211_M_MONITOR; +#ifdef IEEE80211_M_MBSS if (ifmr.ifm_current & IFM_IEEE80211_MBSS) return IEEE80211_M_MBSS; +#endif /* IEEE80211_M_MBSS */ } return IEEE80211_M_STA; } @@ -324,7 +326,9 @@ bsd_set_key(const char *ifname, void *priv, enum wpa_alg alg, size_t seq_len, const u8 *key, size_t key_len) { struct ieee80211req_key wk; +#ifdef IEEE80211_KEY_NOREPLAY struct bsd_driver_data *drv = priv; +#endif /* IEEE80211_KEY_NOREPLAY */ wpa_printf(MSG_DEBUG, "%s: alg=%d addr=%p key_idx=%d set_tx=%d " "seq_len=%zu key_len=%zu", __func__, alg, addr, key_idx, @@ -380,12 +384,14 @@ bsd_set_key(const char *ifname, void *priv, enum wpa_alg alg, if (wk.ik_keyix != IEEE80211_KEYIX_NONE && set_tx) wk.ik_flags |= IEEE80211_KEY_DEFAULT; #ifndef HOSTAPD +#ifdef IEEE80211_KEY_NOREPLAY /* * Ignore replay failures in IBSS and AHDEMO mode. */ if (drv->opmode == IEEE80211_M_IBSS || drv->opmode == IEEE80211_M_AHDEMO) wk.ik_flags |= IEEE80211_KEY_NOREPLAY; +#endif /* IEEE80211_KEY_NOREPLAY */ #endif /* HOSTAPD */ wk.ik_keylen = key_len; if (seq) {