Bug 48622 - "ip address flush" also removes the IPv6 link-local adress - breaks ucs-test
"ip address flush" also removes the IPv6 link-local adress - breaks ucs-test
Status: NEW
Product: UCS
Classification: Unclassified
Component: System setup
UCS 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS maintainers
UCS maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-02-07 10:05 CET by Philipp Hahn
Modified: 2019-02-07 12:24 CET (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 6: Setup Problem: Issue for the setup process
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.069
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:
hahn: Patch_Available+


Attachments
Hacked FlushOldAddresses.py with additional debug output (578 bytes, text/plain)
2019-02-07 10:05 CET, Philipp Hahn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2019-02-07 10:05:22 CET
Created attachment 9831 [details]
Hacked FlushOldAddresses.py with additional debug output

/usr/lib/univention-system-setup/scripts/setup-join.sh:202
> run-parts -v -a --network-only -a --appliance-mode -- /usr/lib/univention-system-setup/scripts/30_net
...
/usr/lib/univention-system-setup/scripts/30_net/10interfaces
...
/usr/share/pyshared/univention/management/console/modules/setup/netconf/modules/FlushOldAddresses.py:14
> self.call(["ip", "addr", "flush", iface.name])

This also flushes the IPv6 link-local address, which breaks ucs-kvm-create which is no longer able to connect to the VM.

I verified this using the attached version of FlushOldAddresses.py:

> ERROR:uss.network.phase.FlushOldAddresses:pre
> 3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
>     link/ether 52:54:00:80:ed:f9 brd ff:ff:ff:ff:ff:ff
>     inet6 fe80::5054:ff:fe80:edf9/64 scope link 
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>        valid_lft forever preferred_lft forever

> ERROR:uss.network.phase.FlushOldAddresses:post
> 3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
>     link/ether 52:54:00:80:ed:f9 brd ff:ff:ff:ff:ff:ff

From <man:ip-address(8)>:
> ip address flush dev eth4 scope global
>   Removes all global IPv4 and IPv6 addresses from device eth4. Without 'scope global' it would remove all addresses including IPv6 link-local ones.

We should just add that "scope global" to "FlushOldAddresses.py":

diff --git a/base/univention-system-setup/umc/python/setup/netconf/modules/FlushOldAddresses.py b/base/univention-system-setup/umc/python/setup/netconf/modules/FlushOldAddresses.py
index 27cd55b87c..ed8954ec1b 100644
--- a/base/univention-system-setup/umc/python/setup/netconf/modules/FlushOldAddresses.py
+++ b/base/univention-system-setup/umc/python/setup/netconf/modules/FlushOldAddresses.py
@@ -11,4 +11,4 @@ class PhaseFlushOldAddresses(Phase):
        def pre(self):
                super(PhaseFlushOldAddresses, self).pre()
                for _name, iface in self.changeset.old_interfaces.all_interfaces:
-                       self.call(["ip", "addr", "flush", iface.name])
+                       self.call(["ip", "addr", "flush", iface.name, "scope", "global"])
Comment 1 Erik Damrose univentionstaff 2019-02-07 10:32:26 CET
This change was at least in our images starting with UCS 4.3-3, there are no problems to create UCS Appliances and App Appliances to my knowledge.
In which scenario does this break?

The change to flush the interfaces also in appliance mode was done in Bug #47767, git show 31d208400e7f6c2e3afb41689540e3f1016e1713
Comment 2 Philipp Hahn univentionstaff 2019-02-07 12:12:50 CET
(In reply to Erik Damrose from comment #1)
> This change was at least in our images starting with UCS 4.3-3, there are no
> problems to create UCS Appliances and App Appliances to my knowledge.
> In which scenario does this break?

# umc-client -U Administrator -P univention command setup/net/apply -e -o '{"values":{"interfaces":{"eth0":{"name":"eth0","interfaceType":"Ethernet","ip4dynamic":True},"eth1":{"name":"eth1","interfaceType":"Ethernet"}}}}'
# ip --color address show eth1
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 52:54:00:80:ed:f9 brd ff:ff:ff:ff:ff:ff

Happened to me while writing a test for Bug #48427