17 |
+ # we test for a valid mask or bit mask |
+ # we test for a valid mask or bit mask |
18 |
+ my $tip="192.168.50.1"; |
+ my $tip="192.168.50.1"; |
19 |
+ my $block = new Net::Netmask("$tip/$data") or return "INVALID_SUBNET_MASK"; |
+ my $block = new Net::Netmask("$tip/$data") or return "INVALID_SUBNET_MASK"; |
20 |
+ if ($block->{'ERROR'} eq "" && ($block->mask() eq "$data" || $block->bits() eq "$data")) |
+ if ($block->mask() eq "$data" || $block->bits() eq "$data") |
21 |
{ |
{ |
22 |
return "OK"; |
return "OK"; |
23 |
} |
} |
65 |
+ # we test for a valid mask or bit mask |
+ # we test for a valid mask or bit mask |
66 |
+ my $tip="192.168.50.1"; |
+ my $tip="192.168.50.1"; |
67 |
+ my $block = new Net::Netmask("$tip/$mask") or return "INVALID_SUBNET_MASK"; |
+ my $block = new Net::Netmask("$tip/$mask") or return "INVALID_SUBNET_MASK"; |
68 |
+ if ($block->{'ERROR'} eq "" && ($block->mask() eq "$mask" || $block->bits() eq "$mask")) |
+ if ($block->mask() eq "$mask" || $block->bits() eq "$mask") |
69 |
{ |
{ |
70 |
return "OK"; |
return "OK"; |
71 |
} |
} |