mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 11:43:25 +02:00
general-functions.pl: Remove getlastip/getnextip
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
@@ -172,12 +172,12 @@ sub setup_default_networks
|
|||||||
&readhash("${General::swroot}/vpn/settings", \%ipsecsettings);
|
&readhash("${General::swroot}/vpn/settings", \%ipsecsettings);
|
||||||
if($ipsecsettings{'RW_NET'} ne '')
|
if($ipsecsettings{'RW_NET'} ne '')
|
||||||
{
|
{
|
||||||
my ($ip,$sub) = split(/\//,$ipsecsettings{'RW_NET'});
|
my $netaddress = &Network::get_netaddress($ipsecsettings{'RW_NET'});
|
||||||
$sub=&General::iporsubtocidr($sub);
|
my $prefix = &Network::get_prefix($ipsecsettings{'RW_NET'});
|
||||||
my @tempipsecsubnet = split("\/", $ipsecsettings{'RW_NET'});
|
|
||||||
$defaultNetworks->{'IPsec RW (' .$ip."/".$sub.")"}{'ADR'} = $tempipsecsubnet[0];
|
$defaultNetworks->{"IPsec RW (${netaddress}/${prefix})"}{'ADR'} = $netaddress;
|
||||||
$defaultNetworks->{'IPsec RW (' .$ip."/".$sub.")"}{'NAME'} = "IPsec RW";
|
$defaultNetworks->{"IPsec RW (${netaddress}/${prefix})"}{'NAME'} = "IPsec RW";
|
||||||
$defaultNetworks->{'IPsec RW (' .$ip."/".$sub.")"}{'NET'} = &getnextip($ip);
|
$defaultNetworks->{"IPsec RW (${netaddress}/${prefix})"}{'NET'} = $netaddress;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -448,14 +448,6 @@ sub dec2ip {
|
|||||||
return &Network::bin2ip(shift);
|
return &Network::bin2ip(shift);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub getnextip {
|
|
||||||
return &Network::find_next_ip_address(shift, 4);
|
|
||||||
}
|
|
||||||
|
|
||||||
sub getlastip {
|
|
||||||
return &Network::find_next_ip_address(shift, -1);
|
|
||||||
}
|
|
||||||
|
|
||||||
sub validipandmask
|
sub validipandmask
|
||||||
{
|
{
|
||||||
#Gets: Ip address in 192.168.0.0/24 or 192.168.0.0/255.255.255.0 and checks if subnet valid
|
#Gets: Ip address in 192.168.0.0/24 or 192.168.0.0/255.255.255.0 and checks if subnet valid
|
||||||
|
|||||||
Reference in New Issue
Block a user