summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/vyatta-show-conntrack.pl18
1 files changed, 17 insertions, 1 deletions
diff --git a/scripts/vyatta-show-conntrack.pl b/scripts/vyatta-show-conntrack.pl
index cad954b..0d0cc95 100755
--- a/scripts/vyatta-show-conntrack.pl
+++ b/scripts/vyatta-show-conntrack.pl
@@ -216,9 +216,9 @@ if ($family eq "ipv4") {
}
} else {
#placeholder for v6 code.
- die "IPv6 Conntrack commands are not supported yet\n";
if (defined $sourceIP) {
if (($sourceIP =~ m/]/)) {
+ # [IPv6-address]:port
my @address = split(/]/, $sourceIP);
if (@address) {
$sourceIP = substr($address[0], 1);
@@ -237,6 +237,14 @@ if ($family eq "ipv4") {
$command .= " -s $sourceIP --orig-port-src $sourcePort";
print "IP $sourceIP port $sourcePort\n";
}
+ } else {
+ #IPv6-address without port
+ if (validateType('ipv6', $sourceIP)) {
+ #Valid ipv6 address.
+ $command .= " -s $sourceIP";
+ } else {
+ die "Please enter a valid source IPv6 address\n";
+ }
}
}
if (defined $destIP) {
@@ -259,6 +267,14 @@ if ($family eq "ipv4") {
$command .= " -d $destIP --orig-port-dst $destPort";
print "IP $sourceIP port $sourcePort\n";
}
+ } else {
+ #IPv6-address without port
+ if (validateType('ipv6', $destIP)) {
+ #Valid ipv6 address.
+ $command .= " -d $destIP";
+ } else {
+ die "Please enter a valid destination IPv6 address\n";
+ }
}
}
}