ucentral-event: Add DVLAN uplink to dhcpsnoop

When an uplink interface is created for a DVLAN due to swconfig support,
add this new interface to dhcpsnoop

Signed-off-by: Paul White <paul@shasta.cloud>
This commit is contained in:
Paul White
2024-01-21 05:51:57 +00:00
committed by John Crispin
parent 6fc396682c
commit 4d2603b4ce

View File

@@ -132,9 +132,12 @@ handlers = {
name: 'eth0.' + notify.data.vlan_id,
vlan: [ `${notify.data.vlan_id}:u` ]
};
ubus.call('network.interface.up_none', 'add_device', msg);
msg = { 'devices': { } };
msg['devices']['eth0.' + notify.data.vlan_id] = { 'ingress': true, 'egress': true };
ubus.call('dhcpsnoop', 'add_devices', msg);
let cmd = 'swconfig dev ' + config.config.swconfig + ' vlan ' + notify.data.vlan_id + ' set ports \"' + join(' ', config.config.swconfig_ports) + '\"';
system(cmd);
system('swconfig dev ' + config.config.swconfig + ' set apply');