summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-delete-conntrack.pl18
-rwxr-xr-xscripts/vyatta-show-conntrack.pl17
2 files changed, 27 insertions, 8 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";
diff --git a/scripts/vyatta-show-conntrack.pl b/scripts/vyatta-show-conntrack.pl
index bfbc63e..57a9799 100755
--- a/scripts/vyatta-show-conntrack.pl
+++ b/scripts/vyatta-show-conntrack.pl
@@ -80,10 +80,19 @@ sub print_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";