Accepts addresses with no profix or no vlan in lua/admin/manage_pool_members.lua

This commit is contained in:
Alfredo Cardigliano 2022-10-17 17:06:22 +02:00
parent 52c316d214
commit 6fcbcdd036
5 changed files with 85 additions and 20 deletions

View file

@ -105,11 +105,11 @@ local function delete_host_mysql_flows(interface_id, host_info)
local q
if isIPv4(addr) then
q = string.format("DELETE FROM %s WHERE (IP_SRC_ADDR = INET_ATON('%s') OR IP_DST_ADDR = INET_ATON('%s')) AND VLAN_ID = %u and INTERFACE_ID = %d",
"flowsv4", addr, addr, vlan, interface_id)
q = string.format("DELETE FROM %s WHERE (IP_SRC_ADDR = INET_ATON('%s') OR IP_DST_ADDR = INET_ATON('%s')) AND VLAN_ID = %u and INTERFACE_ID = %d",
"flowsv4", addr, addr, vlan, interface_id)
elseif isIPv6(addr) then
q = string.format("DELETE FROM %s WHERE (IP_SRC_ADDR = '%s' OR IP_DST_ADDR = '%s') AND VLAN_ID = %u AND INTERFACE_ID = %d",
"flowsv6", addr, addr, vlan, interface_id)
q = string.format("DELETE FROM %s WHERE (IP_SRC_ADDR = '%s' OR IP_DST_ADDR = '%s') AND VLAN_ID = %u AND INTERFACE_ID = %d",
"flowsv6", addr, addr, vlan, interface_id)
end
if not dry_run and q then