]> git.proxmox.com Git - pve-manager.git/commitdiff
network config: allow empty IP address/netmask
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 5 Mar 2013 05:48:26 +0000 (06:48 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 5 Mar 2013 05:48:26 +0000 (06:48 +0100)
bump version to 2.3-13

PVE/API2/Network.pm
debian/changelog.Debian
defines.mk

index db32c8ec05ee64ebb273a07bf465a2c8a6dbbd12..35b077b97baf6495f9cbb05d5a61cefda6967f33 100644 (file)
@@ -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'; 
 
index aa21812407e4980429f92e228b8e7cb729ee6d1a..c25ea2571920764d8d2ed7b11b734b29c5855545 100644 (file)
@@ -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)
index 7258f9d53823139bc69400241886678b2feddbb7..bd651b817fdc4b81433c0e064861cf2056387d5f 100644 (file)
@@ -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