Hi TAHI Project folks,
I found an issue in DHCPv6_Self_Test_P2_1_0_13.
At the routine to get a byte sequence of a linklayer address from the
previous message, it simply removes colon(:) from the character string
of the linklayer address.
However, it doesn't work well for the string which omits proceeding 0,
e.g. 00:01:02:34:05:67. This example becomes 01234567 wrongly.
It should be 000102340567.
I attach a proposal patch here. Could you review this?
Thank you,
----
Mitsuru Chinen <mitch@linux.vnet.ibm.com>
--- DHCPv6_Self_Test_P2_1_0_13.orig/DHCPv6_common.pm 2008-10-03 13:18:12.000000000 +0900
+++ DHCPv6_Self_Test_P2_1_0_13/DHCPv6_common.pm 2008-10-29 20:12:00.000000000 +0900
@@ -1688,7 +1688,14 @@ sub GetSvrDUIDfromPreMsg($$){
my $hardwaretype = $$ref_msg{"$duidindexname.HardwareType"};
my $time = $$ref_msg{"$duidindexname.Time"};
my $linkerlayeraddress = $$ref_msg{"$duidindexname.LinkLayerAddress"};
- $linkerlayeraddress =~ s/://g;
+ if($linkerlayeraddress =~ /(\w+):(\w+):(\w+):(\w+):(\w+):(\w+)/) {
+ $linkerlayeraddress = sprintf("%02s%02s%02s%02s%02s%02s",
+ $1, $2, $3, $4, $5, $6);
+ } else {
+ vLogHTML("The format of linklayer address is wrong!<BR>");
+ return (1,$cpp);
+ }
+
my $endofaddress = $$ref_msg{"$duidindexname.[Needless].data"};
if(defined($endofaddress)){