[pve-devel] applied: [PATCH manager] fix #2267: delete address(6) and netmas(6) with cidr(6)

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Jul 8 19:21:36 CEST 2019


On 7/8/19 4:29 PM, Dominik Csapak wrote:
> otherwise a user cannot delete an ip from an interface
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  PVE/API2/Network.pm | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/PVE/API2/Network.pm b/PVE/API2/Network.pm
> index 00337fe2..5e2abda1 100644
> --- a/PVE/API2/Network.pm
> +++ b/PVE/API2/Network.pm
> @@ -435,6 +435,13 @@ __PACKAGE__->register_method({
>  		delete $ifaces->{$iface}->{$k};
>  		@$families = grep(!/^inet$/, @$families) if $k eq 'address';
>  		@$families = grep(!/^inet6$/, @$families) if $k eq 'address6';
> +		if ($k eq 'cidr') {
> +		    delete $ifaces->{$iface}->{netmask};
> +		    delete $ifaces->{$iface}->{address};
> +		} elsif ($k eq 'cidr6') {
> +		    delete $ifaces->{$iface}->{netmask6};
> +		    delete $ifaces->{$iface}->{address6};
> +		}
>  	    }
>  
>  	    $map_cidr_to_address_netmask->($param);
> 

applied to master and stable-5




More information about the pve-devel mailing list