diff --git a/feeds/ucentral/ucentral-event/files/ucentral-event b/feeds/ucentral/ucentral-event/files/ucentral-event index 29c0ec6c2..2462fadab 100755 --- a/feeds/ucentral/ucentral-event/files/ucentral-event +++ b/feeds/ucentral/ucentral-event/files/ucentral-event @@ -122,6 +122,7 @@ let handlers = { vlan: [ `${notify.data.vlan_id}:t` ] }; ubus.call('network.interface.up_none', 'add_device', msg); + ubus.call('udevstats', 'add_device', { device: wan, vlan: +notify.data.vlan_id }); } let msg = { diff --git a/feeds/ucentral/udevstats/files/udevstats.uc b/feeds/ucentral/udevstats/files/udevstats.uc index ddba57392..3d9a0ddb3 100644 --- a/feeds/ucentral/udevstats/files/udevstats.uc +++ b/feeds/ucentral/udevstats/files/udevstats.uc @@ -215,6 +215,21 @@ function run_service() { }, 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: { call: function(req) { let old_config = vlan_config;