diff options
author | Gaurav Sinha <gaurav.sinha@vyatta.com> | 2011-11-16 13:53:49 -0800 |
---|---|---|
committer | Gaurav Sinha <gaurav.sinha@vyatta.com> | 2011-11-16 13:53:49 -0800 |
commit | 2f46daed416bcb38267da6f16879654b16b6a99e (patch) | |
tree | 81e7fd481071d724b3030d37ad83377a7d7565bc | |
parent | c5965014599abdf5a7612e0cbe77a7a490c752c4 (diff) | |
download | vyatta-conntrack-2f46daed416bcb38267da6f16879654b16b6a99e.tar.gz vyatta-conntrack-2f46daed416bcb38267da6f16879654b16b6a99e.zip |
bug 7411:IPv6 show command without port
-rwxr-xr-x | scripts/vyatta-show-conntrack.pl | 18 |
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"; + } } } } |