Bug 29973 - Redirect to new IP during system-setup not reliable enough
Redirect to new IP during system-setup not reliable enough
Product: UCS
Classification: Unclassified
Component: UMC - Basic settings
UCS 3.1
Other Linux
: P4 enhancement (vote)
: UCS 3.2
Assigned To: Florian Best
Dirk Wiesenthal
: interim-1
Depends on:
  Show dependency treegraph
Reported: 2013-01-09 12:17 CET by Dirk Wiesenthal
Modified: 2013-11-19 06:44 CET (History)
3 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Usability
Max CVSS v3 score:
klaeser: Patch_Available+

Search in all interfaces if IP changed. Only find changes if it is the current IP (989 bytes, patch)
2013-01-09 12:17 CET, Dirk Wiesenthal
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Wiesenthal univentionstaff 2013-01-09 12:17:44 CET
Created attachment 4966 [details]
Search in all interfaces if IP changed. Only find changes if it is the current IP

If the user changes the IP in Basic Settings, the server cannot be contacted
anymore as soon as these changes are saved in the backend. This is handled by
the frontend by pointing to the new destination.

This does not work in some cases where there is more than one network interface
(say eth0 and eth1).
1. The frontend thinks the IP changed although it has not if the user browsed
to eth1's IP and changed eth0's
2. The frontend does not think the IP changed although it has if the user
browsed to eth1's IP and changed eth1's

Patch attached.
Comment 1 Moritz Muehlenhoff univentionstaff 2013-05-31 10:45:19 CEST
We will not ship a UCS 3.1-2 release; the next UCS release will be UCS 3.2.

As such, this bug is moved to the new target milestone.
Comment 2 Florian Best univentionstaff 2013-07-12 09:15:46 CEST
The heuristic has been adapted at Bug #30816.

It now does:
* check if the current IP changes at the same interface
* check if the interface was deleted and use the new primary interface (or eth0 if not set)

*** This bug has been marked as a duplicate of bug 30816 ***
Comment 3 Dirk Wiesenthal univentionstaff 2013-08-19 12:52:36 CEST
Please fix this separately as this is not really a duplicate of "Support of VLAN, Bonding, Bridges" (+ Changelog)

if (!(/[.]/).test(oldIp)) {
  oldIp = '\\[' + oldIp + '\\]';

This will be executed for:
 * "https://master/umc" -> "https://[master]/umc"
 * "https://[ipv6]/umc" -> "https://[[ipv6]]/umc"

This if statement should be removed.

setup.js / _getNewIpAddress:
if (oldIp == currentIP) {
  newIpAddress = prim.ip4[0][0];

What if the primary interface only has IPv6? There should be a redirect to that address in this case. Same holds for "else if (oldIp6 == currentIP)". Primary's IPv6 should have higher priority in IPv6 case.
Comment 4 Florian Best univentionstaff 2013-08-20 12:29:16 CEST
Ok, this has been adapted.

The order of IP address detection is:
for IPv4 devices:
newIP4 || primIP4 || newIP6 || primIP6

for IPv6 devices:
newIP6 || primIP6 || newIP4 || primIP4
Comment 5 Dirk Wiesenthal univentionstaff 2013-08-21 15:58:39 CEST

window.location.host = '[ipv6]', i.e. with brackets. So _getNewIpAdress does not work. And "if (!(/[.]/).test(oldIp)) {" (see Comment 3) should be re-evaluated.
Comment 6 Florian Best univentionstaff 2013-08-22 12:41:39 CEST
fixed in univention-system-setup (7.0.29-1)
Comment 7 Dirk Wiesenthal univentionstaff 2013-08-22 16:45:49 CEST
Changeset: Ok
Changelog: Ok
Comment 8 Stefan Gohmann univentionstaff 2013-11-19 06:44:22 CET
UCS 3.2 has been released:

If this error occurs again, please use "Clone This Bug".