mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-11-02 11:27:48 +00:00
udevstats: add support for dynamic vlans
Fixes: WIFI-12582 Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
@@ -122,6 +122,7 @@ let handlers = {
|
|||||||
vlan: [ `${notify.data.vlan_id}:t` ]
|
vlan: [ `${notify.data.vlan_id}:t` ]
|
||||||
};
|
};
|
||||||
ubus.call('network.interface.up_none', 'add_device', msg);
|
ubus.call('network.interface.up_none', 'add_device', msg);
|
||||||
|
ubus.call('udevstats', 'add_device', { device: wan, vlan: +notify.data.vlan_id });
|
||||||
}
|
}
|
||||||
|
|
||||||
let msg = {
|
let msg = {
|
||||||
|
|||||||
@@ -215,6 +215,21 @@ function run_service() {
|
|||||||
},
|
},
|
||||||
args: {}
|
args: {}
|
||||||
},
|
},
|
||||||
|
add_device: {
|
||||||
|
call: function(req) {
|
||||||
|
if (!req.args.device || !req.args.vlan)
|
||||||
|
return ubus.STATUS_INVALID_ARGUMENT;
|
||||||
|
if (!vlan_config[req.args.device])
|
||||||
|
vlan_config[req.args.device] = [];
|
||||||
|
push(vlan_config[req.args.device], [ req.args.vlan, "rx", "tx"]);
|
||||||
|
vlan_set_config(vlan_config);
|
||||||
|
return 0;
|
||||||
|
},
|
||||||
|
args: {
|
||||||
|
"device": "wlan0",
|
||||||
|
"vlan": 100,
|
||||||
|
}
|
||||||
|
},
|
||||||
reset: {
|
reset: {
|
||||||
call: function(req) {
|
call: function(req) {
|
||||||
let old_config = vlan_config;
|
let old_config = vlan_config;
|
||||||
|
|||||||
Reference in New Issue
Block a user