- for (@_) {
- push @in, [inet_pton(m|:|?AF_INET6:AF_INET, $_), split m|/|];
+ my $c;
+ for my $i (@_) {
+ my @s;
+
+ my @ip = split m|/|, $i;
+ if ($ip[0] =~ /:/) {
+ @s = map{$_ ? hex($_) : 0} split /:/, $ip[0];
+ } else {
+ @s = map{$_ ? $_+0 : 0} split /\./, $ip[0];
+ }
+ while (@s < 8) {
+ push @s, 0;
+ }
+# my $s = pack "S*", reverse @s;
+ my $s = pack "n*", @s;
+# my $s = join ':', map {sprintf "%04d:", $_} @s;
+# push @in, [inet_pton(m|:|?AF_INET6:AF_INET, $ip[0]), @ip];
+ push @in, [$s, @ip];