diff options
Diffstat (limited to 'scripts/vyatta-delete-conntrack.pl')
-rwxr-xr-x | scripts/vyatta-delete-conntrack.pl | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/scripts/vyatta-delete-conntrack.pl b/scripts/vyatta-delete-conntrack.pl index 96f176d..ccd69de 100755 --- a/scripts/vyatta-delete-conntrack.pl +++ b/scripts/vyatta-delete-conntrack.pl @@ -99,10 +99,20 @@ sub print_data_from_xml { $timeout, $state_connection); $proto = $proto{original}; $protonum = $protonum{original}; - $in_src = "$src{original}"; - $in_src .= ":$sport{original}" if defined $sport{original}; - $in_dst = "$dst{original}"; - $in_dst .= ":$dport{original}" if defined $dport{original}; + if (( $family eq 'ipv6') and (defined $sport{original})) { + $in_src = "\[$src{original}]:$sport{original}"; + } else { + $in_src = "$src{original}"; + $in_src .= ":$sport{original}" if defined $sport{original}; + } + + if (( $family eq 'ipv6') and (defined $dport{original})) { + $in_dst = "\[$dst{original}]:$dport{original}"; + } else { + $in_dst = "$dst{original}"; + $in_dst .= ":$dport{original}" if defined $dport{original}; + } + $connection_id = "$connection_id_ref"; $timeout = "$timeout_ref"; |