Commit 7946f1f1 authored by Dietmar Maurer's avatar Dietmar Maurer

network config: allow empty IP address/netmask

bump version to 2.3-13
parent ad9c5c05
......@@ -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';
......
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment