nl80211 driver: fix beacon interval setting
authorJohannes Berg <johannes@sipsolutions.net>
Wed, 9 Apr 2008 07:11:04 +0000 (10:11 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 9 Apr 2008 07:11:04 +0000 (10:11 +0300)
This removes the hard-coded beacon interval setting.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
hostapd/driver_nl80211.c

index 4a2d44c..2fdfa57 100644 (file)
@@ -66,7 +66,7 @@ struct i802_driver_data {
        struct nl_handle *nl_handle;
        struct nl_cache *nl_cache;
        struct genl_family *nl80211;
-       int dtim_period;
+       int dtim_period, beacon_int;
        unsigned int beacon_set:1;
        unsigned int ieee802_1x_active:1;
 };
@@ -1060,7 +1060,7 @@ static int i802_set_beacon(const char *iface, void *priv,
        NLA_PUT(msg, NL80211_ATTR_BEACON_HEAD, head_len, head);
        NLA_PUT(msg, NL80211_ATTR_BEACON_TAIL, tail_len, tail);
        NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, if_nametoindex(iface));
-       NLA_PUT_U32(msg, NL80211_ATTR_BEACON_INTERVAL, 1000);
+       NLA_PUT_U32(msg, NL80211_ATTR_BEACON_INTERVAL, drv->beacon_int);
 
        if (!drv->dtim_period)
                drv->dtim_period = 2;
@@ -1149,6 +1149,8 @@ static int i802_set_beacon_int(void *priv, int value)
        struct nl_msg *msg;
        int ret = -1;
 
+       drv->beacon_int = value;
+
        msg = nlmsg_alloc();
        if (!msg)
                goto out;