Compare commits

...

23 Commits

Author SHA1 Message Date
jaspreetsachdev
25d7b9d62d Merge pull request #485 from Telecominfraproject/main
Merge fixes for WIFI-11208 and others
2022-10-19 10:02:25 -04:00
jaspreetsachdev
6eaef7adad Merge pull request #484 from Telecominfraproject/2.7.1-fixes-from-next
2.7.1 fixes from next
2022-10-17 15:41:09 -04:00
John Crispin
0272d4bcad hostapd: AAA WISPr rates are sent as mbit
Signed-off-by: John Crispin <john@phrozen.org>
2022-10-17 15:35:20 -04:00
John Crispin
41c64e9978 spotfilter: fix a use-after-free
Signed-off-by: John Crispin <john@phrozen.org>
2022-10-17 15:35:20 -04:00
John Crispin
9c2f0a098d uspot: dns_state was not getting reset correctly when flushing a client
Signed-off-by: John Crispin <john@phrozen.org>
2022-10-17 15:35:20 -04:00
John Crispin
0bb8d0dcc0 uspot: Session-Timeout AVP was not correctly honoured
Fixes: WIFI-10663
Signed-off-by: John Crispin <john@phrozen.org>
2022-10-17 15:35:19 -04:00
John Crispin
a542660072 uspot: idle-timeout failed for non radius backed clients
Fixes: WIIF-11208
Signed-off-by: John Crispin <john@phrozen.org>
2022-10-17 15:35:19 -04:00
John Crispin
8ee15d0053 uspot: fix unreolved variable in mac-format handler
Fixes: WIFI-11204
Signed-off-by: John Crispin <john@phrozen.org>
2022-10-17 15:35:19 -04:00
John Crispin
311515867c uspot: add ssid to called-station-id
Signed-off-by: John Crispin <john@phrozen.org>
2022-10-17 15:35:19 -04:00
jaspreetsachdev
16bbcddd40 Merge branch 'main' of github.com:Telecominfraproject/wlan-ap 2022-10-17 14:24:06 -04:00
jaspreetsachdev
ca26d347eb Merge branch 'main' of github.com:Telecominfraproject/wlan-ap 2022-09-29 21:53:47 -04:00
Sohail Ahmad
9eeefa2fbf ipq807x: Support for Indio WiFi6 AP -indoor and outdoor models based on IPQ6000
Fixes: WIFI-10802
Signed-off-by: Sohail Ahmad <sohail.ahmad@wifi-soft.com>
2022-09-26 18:00:41 +02:00
Felix Fietkau
c33705ca60 qosify: update to the latest version
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-09-26 15:00:33 +02:00
Arif Alam
ba41e6773b ipq807x: Fix EAP104 upgrade
Signed-off-by: Arif Alam <arif.alam@netexperience.com>
2022-09-23 17:19:01 +02:00
John Crispin
8ebf884436 spotfilter: add a maissing v5.4 kernel backport
fixes an off-by-one bug in the validator

Signed-off-by: John Crispin <john@phrozen.org>
2022-09-23 17:19:01 +02:00
John Crispin
7d4353caf0 ucentral-client: update to latest HEAD
update wifi-scan timeout to 120s

Signed-off-by: John Crispin <john@phrozen.org>
2022-09-23 17:19:01 +02:00
John Crispin
fa6220a615 ucentral-schema: update to latest HEAD
55b8272 add support for overriding country codes

Signed-off-by: John Crispin <john@phrozen.org>
2022-09-22 15:14:05 +02:00
Felix Fietkau
26517bb6ae qosify: update to the latest version
fixes classification on linux 4.4

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-09-22 07:47:21 +02:00
Felix Fietkau
ea4c4b3fe5 wifi-ax: backport mac80211 WME classification fix
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-09-22 07:47:01 +02:00
John Crispin
00f273000e mac80211: fix multiple bssid mac addresses
Fixes: WIFI-10596
Signed-off-by: John Crispin <john@phrozen.org>
2022-09-21 09:45:05 +02:00
Jaspreet Sachdev
6014d3a04d .github/workflows: Removed deprecated targets
Signed-off-by: Jaspreet Sachdev <jaspreetsachdev@fb.com>
2022-09-20 08:56:55 +02:00
John Crispin
08f082acfe uspot: fix a typo causing config to not load correctly
Signed-off-by: John Crispin <john@phrozen.org>
2022-09-19 09:19:01 +02:00
Simon Kinane
12e5efcda4 uspot: Improve HTML for captive portal UI 2022-09-19 09:19:01 +02:00
6 changed files with 38 additions and 13 deletions

View File

@@ -65,6 +65,7 @@ static void __client_free(struct interface *iface, struct client *cl)
avl_delete(&iface->client_ids, &cl->id_node);
avl_delete(&iface->clients, &cl->node);
kvlist_free(&cl->kvdata);
free(cl->device);
spotfilter_bpf_set_client(iface, &cl->key, NULL);
free(cl);
}
@@ -143,8 +144,10 @@ int client_set(struct interface *iface, const void *addr, const char *id,
kvlist_set(&cl->kvdata, blobmsg_name(cur), cur);
}
if (device)
cl->device = device;
if (device) {
free(cl->device);
cl->device = strdup(device);
}
if (state >= 0)
cl->data.cur_class = state;
if (dns_state >= 0)

View File

@@ -17,7 +17,7 @@ struct client {
struct spotfilter_client_key key;
struct spotfilter_client_data data;
const char *device;
char *device;
};
int client_set(struct interface *iface, const void *addr, const char *id,

View File

@@ -32,11 +32,15 @@ function get_idle_timeout(mac) {
}
function get_session_timeout(mac) {
if (clients[mac]?.session_timeout)
return clients[mac].session_timeout;
if (clients[mac]?.session)
return clients[mac].session;
return session_timeout;
}
function radius_available(mac) {
return !!clients[mac]?.radius;
}
function radius_init(mac, payload) {
for (let key in [ 'server', 'acct_server', 'acct_session', 'client_ip', 'called_station', 'calling_station', 'nas_ip', 'nas_id', 'username' ])
if (clients[mac].radius[key])
@@ -53,6 +57,8 @@ function radius_call(mac, payload) {
}
function radius_stop(mac) {
if (!radius_available(mac))
return;
debug(mac, 'stopping accounting');
let payload = {
@@ -88,6 +94,8 @@ function radius_acct(mac, payload) {
}
function radius_idle_time(mac) {
if (!radius_available(mac))
return;
let payload = {
acct_type: 2,
terminate_cause: 4,
@@ -96,6 +104,8 @@ function radius_idle_time(mac) {
}
function radius_session_time(mac) {
if (!radius_available(mac))
return;
let payload = {
acct_type: 2,
terminate_cause: 5,
@@ -104,6 +114,8 @@ function radius_session_time(mac) {
}
function radius_disconnect(mac) {
if (!radius_available(mac))
return;
let payload = {
acct_type: 2,
terminate_cause: 1,
@@ -112,6 +124,8 @@ function radius_disconnect(mac) {
}
function radius_interim(mac) {
if (!radius_available(mac))
return;
let payload = {
acct_type: 3,
};
@@ -126,17 +140,25 @@ function client_add(mac, state) {
if (state.state != 1)
return;
let interval = (state.data?.radius?.reply['Acct-Interim-Interval'] || acct_interval) * 1000;
let idle = (state.data?.radius?.reply['Idle-Timeout'] || idle_timeout);
let session = (state.data?.radius?.reply['Session-Timeout'] || session_timeout);
let interval = acct_interval * 1000;
let idle = idle_timeout;
let session = session_timeout;
let accounting = (config.radius?.acct_server && config.radius?.acct_secret);
if (state.data?.radius?.reply) {
interval = (state.data?.radius?.reply['Acct-Interim-Interval'] || acct_interval) * 1000;
idle = (state.data?.radius?.reply['Idle-Timeout'] || idle_timeout);
session = (state.data?.radius?.reply['Session-Timeout'] || session_timeout);
}
clients[mac] = {
accounting,
radius: state.data.radius.request,
interval,
session,
idle,
};
if (state.data?.radius?.request)
clients[mac].radius= state.data.radius.request;
syslog(mac, 'adding client');
if (accounting)
clients[mac].timeout = uloop.timer(interval, () => radius_interim(mac));
@@ -167,6 +189,7 @@ function client_timeout(mac) {
ubus.call('spotfilter', 'client_set', {
interface: "hotspot",
state: 0,
dns_state: 1,
address: mac,
accounting: [],
flush: true,

View File

@@ -46,7 +46,6 @@ return {
case 'aa-bb-cc-dd-ee-ff':
case 'AA-BB-CC-DD-EE-FF':
mac = replace(mac, ':', '-');
warn('uspot: ' + ctx.env.REMOTE_ADDR + ' - ' + msg + '\n');
break;
}
@@ -140,7 +139,7 @@ return {
acct_server: sprintf('%s:%s:%s', this.config.radius.acct_server, this.config.radius.acct_port, this.config.radius.acct_secret),
acct_session,
client_ip: ctx.env.REMOTE_ADDR,
called_station: this.config.uam.nasmac,
called_station: this.config.uam.nasmac + ':' + ctx.ssid,
calling_station: this.format_mac(ctx.mac),
nas_ip: ctx.env.SERVER_ADDR,
nas_id: this.config.uam.nasid

View File

@@ -120,7 +120,7 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/sta_info.c
else
#endif /* CONFIG_P2P */
- os_snprintf(buf, sizeof(buf), MACSTR, MAC2STR(sta->addr));
+ os_snprintf(buf, sizeof(buf), MACSTR " %d %d", MAC2STR(sta->addr), sta->bandwidth[0] / 1000, sta->bandwidth[1] / 1000);
+ os_snprintf(buf, sizeof(buf), MACSTR " %d %d", MAC2STR(sta->addr), sta->bandwidth[0] / 1000000, sta->bandwidth[1] / 1000000);
if (hapd->sta_authorized_cb)
hapd->sta_authorized_cb(hapd->sta_authorized_cb_ctx,

View File

@@ -137,7 +137,7 @@ index 0000000000..f2f4a933d7
+ else
+ #endif /* CONFIG_P2P */
+- os_snprintf(buf, sizeof(buf), MACSTR, MAC2STR(sta->addr));
++ os_snprintf(buf, sizeof(buf), MACSTR " %d %d", MAC2STR(sta->addr), sta->bandwidth[0] / 1000, sta->bandwidth[1] / 1000);
++ os_snprintf(buf, sizeof(buf), MACSTR " %d %d", MAC2STR(sta->addr), sta->bandwidth[0] / 1000000, sta->bandwidth[1] / 1000000);
+
+ if (hapd->sta_authorized_cb)
+ hapd->sta_authorized_cb(hapd->sta_authorized_cb_ctx,