From 2f46daed416bcb38267da6f16879654b16b6a99e Mon Sep 17 00:00:00 2001 From: Gaurav Sinha Date: Wed, 16 Nov 2011 13:53:49 -0800 Subject: bug 7411:IPv6 show command without port --- scripts/vyatta-show-conntrack.pl | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'scripts') 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"; + } } } } -- cgit v1.2.3