[BlueOnyx:27038] Re: Unable to delete IPv6 in Vsite
Michael Stauber
mstauber at blueonyx.it
Tue Jun 11 21:04:45 -05 2024
Hi Tomohiro,
> System is configured for IPv4 and IPv6.
>
> Vsite is also configured for both.
>
> After that, I tried to empty IPv6 in Vsite, but it is not saved.
>
> I think the code below is wrong.
>
> --- /usr/sausalito/handlers/base/vsite/ipv4_ipv6_check.pl.orig
> 2024-06-11 23:18:20.614509383 +0900
> +++ /usr/sausalito/handlers/base/vsite/ipv4_ipv6_check.pl
> 2024-06-11 23:18:37.110617288 +0900
> @@ -62,7 +62,7 @@
> exit(1);
> }
>
> -if ((($system->{IPType} eq 'VZBOTH') || ($system->{IPType} eq
> 'BOTH')) && (($vsite_new->{ipaddr} eq '') && ($vsite_new->{ipaddrIPv6}
> eq ''))) {
> +if ((($system->{IPType} eq 'VZBOTH') || ($system->{IPType} eq
> 'BOTH')) && (($vsite->{ipaddr} eq '') && ($vsite->{ipaddrIPv6} eq
> ''))) {
> $cce->bye('FAIL',
>
"[[base-vsite.IPValidation_ip_must_be_specified,fqdn='$vsite_old->{fqdn}']]");
> &debug_msg("Fail: IPv4 IP Address empty and IPv6 IP empty. At
> least one must be set!\n");
> exit(1);
>
> $vsite_new is only the difference and $vsite_new is the changed data?
Ok, let's take a look:
my $vsite = $cce->event_object();
my $vsite_new = $cce->event_new();
my $vsite_old = $cce->event_old();
$vsite_old is the CODB data from before the change.
$vsite_new is the data submitted in the form that's supposed to be applied.
$vsite is how the CODB data will look once the transaction goes through.
Therefore this check is correct as is:
# Check if the final result would be that both IPv4 *and* IPv6 would be
empty:
if ((($system->{IPType} eq 'VZBOTH') || ($system->{IPType} eq 'BOTH'))
&& (($vsite->{ipaddr} eq '') && ($vsite->{ipaddrIPv6} eq ''))) {
$cce->bye('FAIL',
"[[base-vsite.IPValidation_ip_must_be_specified,fqdn='$vsite_old->{fqdn}']]");
&debug_msg("Fail5: IPv4 IP Address empty and IPv6 IP empty. At
least one must be set!\n");
exit(1);
}
Because that would trigger if BOTH IPv4 and IPv6 IP address are empty at
the end of the transaction.
However, please note:
======================
I am currently sitting on five weeks worth of unpublished BlueOnyx 5211R
changes. They are currently in the [BlueOnyx-5211R-Testing] YUM
repository and include around 300 updated RPMs and a plethora of code
changes in many modules:
https://devel.blueonyx.it/trac/changeset?reponame=&new=5321%40%2F&old=5260%40%2F
The most drastic changes were made in the base-network module:
https://devel.blueonyx.it/trac/changeset?reponame=&new=5319%40BlueOnyx%2F5211R%2Fui%2Fbase-network.mod&old=5246%40BlueOnyx%2F5211R%2Fui%2Fbase-network.mod
The handler rewrite-ifcfg.pl no longer exists and its functionality has
been replaced by a new trinity of scripts:
/usr/sausalito/handlers/base/network/network_apply.pl
/usr/sausalito/sbin/network_apply_settings.pl
/usr/sausalito/constructor/base/network/30_addNetwork.pl
These are complete rewrites from scratch and set up the network in 100%
NetworkManager conforming steps.
Virtual eth0:X interfaces are gone and all IPs (IPv4 and IPv6) get bound
to the primary network interface.
/usr/sausalito/constructor/base/network/30_addNetwork.pl
That reads the configuration as it is off the network and writes it into
CODB if the physical network and CODB have different data.
These two?
/usr/sausalito/handlers/base/network/network_apply.pl
/usr/sausalito/sbin/network_apply_settings.pl
The first one is triggered by a GUI induced network changes and the
second one can be run manually. They both do the same: They read the
network config from CODB, read the actual state of the physical network
from the interfaces and compare both.
If the physical network has a different configuration than it *should*
be according to CODB, then the interfaces that have pending changes get
configured with the desired configuration.
This also now supports all types of interface names (not just "ethX"),
DHCP as well as bridged networking.
As far as removing the IPv6 IP address from a Vsite goes? I just tested
it on a BlueOnyx 5211R that has all these new development updates
installed and it removed the IPv6 IP address just fine and left the
Vsite available via its IPv4 IP address. Attempting to remove both
yielded the expected error that at least one IP must be set.
But: That error wasn't shown in the GUI due to a minor issue with the
error handling on that page. I just submitted fixes for this to SVN and
updated RPMs for this are now also in the [BlueOnyx-5211R-Testing] YUM
repository.
Many thanks for bringing this to my attention.
--
With best regards
Michael Stauber
More information about the Blueonyx
mailing list