mirror of
https://gitlab.com/shorewall/code.git
synced 2025-01-03 03:59:16 +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;
|
||||
return 0 unless @address == 4;
|
||||
for my $a ( @address ) {
|
||||
return 0 unless $a =~ /^\d+$/ && $a < 256;
|
||||
for ( @address ) {
|
||||
return 0 unless /^\d+$/ && $_ < 256;
|
||||
}
|
||||
|
||||
1;
|
||||
@ -158,8 +158,8 @@ sub decodeaddr( $ ) {
|
||||
|
||||
my $result = shift @address;
|
||||
|
||||
for my $a ( @address ) {
|
||||
$result = ( $result << 8 ) | $a;
|
||||
for ( @address ) {
|
||||
$result = ( $result << 8 ) | $_;
|
||||
}
|
||||
|
||||
$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