mirror of
https://gitlab.com/shorewall/code.git
synced 2025-01-18 11:38:14 +01:00
Minor tweaks to the IPAddrs module
This commit is contained in:
parent
0234564a1b
commit
965ad7ced1
@ -124,8 +124,8 @@ sub valid_4address( $ ) {
|
|||||||
|
|
||||||
my @address = split /\./, $address;
|
my @address = split /\./, $address;
|
||||||
return 0 unless @address == 4;
|
return 0 unless @address == 4;
|
||||||
for my $a ( @address ) {
|
for ( @address ) {
|
||||||
return 0 unless $a =~ /^\d+$/ && $a < 256;
|
return 0 unless /^\d+$/ && $_ < 256;
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
@ -158,8 +158,8 @@ sub decodeaddr( $ ) {
|
|||||||
|
|
||||||
my $result = shift @address;
|
my $result = shift @address;
|
||||||
|
|
||||||
for my $a ( @address ) {
|
for ( @address ) {
|
||||||
$result = ( $result << 8 ) | $a;
|
$result = ( $result << 8 ) | $_;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result;
|
$result;
|
||||||
|
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 101 KiB |
Loading…
Reference in New Issue
Block a user