mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-03 21:10:34 +00:00
network config: allow empty IP address/netmask
bump version to 2.3-13
This commit is contained in:
parent
d09f6f7d3c
commit
1904114e36
@ -58,6 +58,7 @@ my $confdesc = {
|
||||
description => 'Network mask.',
|
||||
type => 'string', format => 'ipv4mask',
|
||||
optional => 1,
|
||||
requires => 'address',
|
||||
},
|
||||
address => {
|
||||
description => 'IP address.',
|
||||
@ -161,14 +162,14 @@ my $check_duplicate_gateway = sub {
|
||||
};
|
||||
|
||||
my $check_ipv4_settings = sub {
|
||||
my $param = $_[0];
|
||||
my ($address, $netmask) = @_;
|
||||
|
||||
my $binip = Net::IP::ip_iptobin($param->{address}, 4);
|
||||
my $binmask = Net::IP::ip_iptobin($param->{netmask}, 4);
|
||||
my $binip = Net::IP::ip_iptobin($address, 4);
|
||||
my $binmask = Net::IP::ip_iptobin($netmask, 4);
|
||||
my $broadcast = Net::IP::ip_iptobin('255.255.255.255', 4);
|
||||
my $binhost = $binip | $binmask;
|
||||
|
||||
raise_param_exc({ address => "$param->{address} is not a valid host ip address." })
|
||||
raise_param_exc({ address => "$address is not a valid host ip address." })
|
||||
if ($binhost eq $binmask) || ($binhost eq $broadcast);
|
||||
};
|
||||
|
||||
@ -204,7 +205,8 @@ __PACKAGE__->register_method({
|
||||
&$check_duplicate_gateway($config, $iface)
|
||||
if $param->{gateway};
|
||||
|
||||
&$check_ipv4_settings($param);
|
||||
&$check_ipv4_settings($param->{address}, $param->{netmask})
|
||||
if $param->{address};
|
||||
|
||||
$param->{method} = $param->{address} ? 'static' : 'manual';
|
||||
|
||||
@ -261,7 +263,8 @@ __PACKAGE__->register_method({
|
||||
&$check_duplicate_gateway($config, $iface)
|
||||
if $param->{gateway};
|
||||
|
||||
&$check_ipv4_settings($param);
|
||||
&$check_ipv4_settings($param->{address}, $param->{netmask})
|
||||
if $param->{address};
|
||||
|
||||
$param->{method} = $param->{address} ? 'static' : 'manual';
|
||||
|
||||
|
6
debian/changelog.Debian
vendored
6
debian/changelog.Debian
vendored
@ -1,3 +1,9 @@
|
||||
pve-manager (2.3-13) unstable; urgency=low
|
||||
|
||||
* network config: allow empty IP address/netmask
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Tue, 05 Mar 2013 06:47:40 +0100
|
||||
|
||||
pve-manager (2.3-12) unstable; urgency=low
|
||||
|
||||
* fix IP address verification (Undefined subroutine &Net::IP::ip_to_bin)
|
||||
|
@ -2,7 +2,7 @@ RELEASE=2.3
|
||||
|
||||
VERSION=2.3
|
||||
PACKAGE=pve-manager
|
||||
PACKAGERELEASE=12
|
||||
PACKAGERELEASE=13
|
||||
|
||||
BINDIR=${DESTDIR}/usr/bin
|
||||
PERLLIBDIR=${DESTDIR}/usr/share/perl5
|
||||
|
Loading…
Reference in New Issue
Block a user