]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix driver_bsd.c build
authorMasashi Honma <honma@ictec.co.jp>
Mon, 7 Dec 2009 19:35:35 +0000 (21:35 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 7 Dec 2009 19:35:35 +0000 (21:35 +0200)
On NetBSD 5.0.1, driver_bsd.c build fails with message below.

../src/drivers/driver_bsd.c: In function 'wpa_driver_bsd_associate':
../src/drivers/driver_bsd.c:1170: warning: implicit declaration of function 'wpa_driver_bsd_set_auth_alg'
../src/drivers/driver_bsd.c: At top level:
../src/drivers/driver_bsd.c:1204: error: static declaration of 'wpa_driver_bsd_set_auth_alg' follows non-static declaration
../src/drivers/driver_bsd.c:1170: error: previous implicit declaration of 'wpa_driver_bsd_set_auth_alg' was here
gmake: *** [../src/drivers/driver_bsd.o] Error 1

This patch solves this issue.

src/drivers/driver_bsd.c

index 7cf6159099e3c12d8a95139f1836b0d321e5ad02..a495f5f6e62e1eeaa0da74a69c21e3c240905fd4 100644 (file)
@@ -1146,6 +1146,23 @@ wpa_driver_bsd_disassociate(void *priv, const u8 *addr, int reason_code)
        return set80211var(drv, IEEE80211_IOC_MLME, &mlme, sizeof(mlme));
 }
 
+static int
+wpa_driver_bsd_set_auth_alg(void *priv, int auth_alg)
+{
+       struct wpa_driver_bsd_data *drv = priv;
+       int authmode;
+
+       if ((auth_alg & AUTH_ALG_OPEN_SYSTEM) &&
+           (auth_alg & AUTH_ALG_SHARED_KEY))
+               authmode = IEEE80211_AUTH_AUTO;
+       else if (auth_alg & AUTH_ALG_SHARED_KEY)
+               authmode = IEEE80211_AUTH_SHARED;
+       else
+               authmode = IEEE80211_AUTH_OPEN;
+
+       return set80211param(drv, IEEE80211_IOC_AUTHMODE, authmode);
+}
+
 static int
 wpa_driver_bsd_associate(void *priv, struct wpa_driver_associate_params *params)
 {
@@ -1199,23 +1216,6 @@ wpa_driver_bsd_associate(void *priv, struct wpa_driver_associate_params *params)
        return ret;
 }
 
-static int
-wpa_driver_bsd_set_auth_alg(void *priv, int auth_alg)
-{
-       struct wpa_driver_bsd_data *drv = priv;
-       int authmode;
-
-       if ((auth_alg & AUTH_ALG_OPEN_SYSTEM) &&
-           (auth_alg & AUTH_ALG_SHARED_KEY))
-               authmode = IEEE80211_AUTH_AUTO;
-       else if (auth_alg & AUTH_ALG_SHARED_KEY)
-               authmode = IEEE80211_AUTH_SHARED;
-       else
-               authmode = IEEE80211_AUTH_OPEN;
-
-       return set80211param(drv, IEEE80211_IOC_AUTHMODE, authmode);
-}
-
 static int
 wpa_driver_bsd_scan(void *priv, struct wpa_driver_scan_params *params)
 {