diff --git a/PVE/API2/Network.pm b/PVE/API2/Network.pm index db32c8ec..35b077b9 100644 --- a/PVE/API2/Network.pm +++ b/PVE/API2/Network.pm @@ -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'; diff --git a/debian/changelog.Debian b/debian/changelog.Debian index aa218124..c25ea257 100644 --- a/debian/changelog.Debian +++ b/debian/changelog.Debian @@ -1,3 +1,9 @@ +pve-manager (2.3-13) unstable; urgency=low + + * network config: allow empty IP address/netmask + + -- Proxmox Support Team 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) diff --git a/defines.mk b/defines.mk index 7258f9d5..bd651b81 100644 --- a/defines.mk +++ b/defines.mk @@ -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