Bug 29571 - Traceback: Vergleich IPv4Address und IPv6Address im Network-Objekt
Traceback: Vergleich IPv4Address und IPv6Address im Network-Objekt
Status: CLOSED WORKSFORME
Product: UCS
Classification: Unclassified
Component: UMC - Networks
UCS 5.0
All Linux
: P5 normal (vote)
: ---
Assigned To: Florian Best
https://git.knut.univention.de/univen...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-05 15:31 CET by Philipp Hahn
Modified: 2022-03-10 14:08 CET (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 2: Improvement: Would be a product improvement
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 1: Nuisance – not a big deal but noticeable
User Pain: 0.023
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Error handling, IPv6
Max CVSS v3 score:
best: Patch_Available+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2012-12-05 15:31:00 CET
Versuch automatisch IPv6-Adressen zu vergeben: "Network"-Objekt "default" geöffnet und beim zu vergebenden IP-Adress-Bereich zusätzlich zu den bestehenden IPv4-Einstellungen zwei IPv6-Adressen eingetragen. Speichern:

Internal module error: An error occurred during command processing
...
File "/usr/lib/pymodules/python2.6/univention/admon/handlers/network/network.py", line 261
 self.sort_ipranges()
File "/usr/lib/pymodules/python2.6/univention/admon/handlers/network/network.py", line 304
 if ipaddr.IPAddress(self['ipRange'][i][0]) < ipaddr.IPAddress(self['ipRange'][i-1][0]):
File "/usr/lib/python2.6/dist-packages/ipaddr.py", line 441, in __lt__
 str(self), str(other)))

TypeError: 2001:4dd0:ff00:8c42:ff17::2 and 192.168.123.10 are not of the same version
Comment 1 Florian Best univentionstaff 2017-10-27 14:33:52 CEST
# udm networks/network create --set name=network1 --set network=10.200.27.0 --set netmask=24 --append ipRange="10.200.27.2 10.200.27.200" --append ipRange="::1 ::2"
Traceback (most recent call last):
  File "/usr/share/univention-directory-manager-tools/univention-cli-server", line 218, in doit
    output = univention.admincli.admin.doit(arglist)
  File "/usr/lib/pymodules/python2.7/univention/admincli/admin.py", line 398, in doit
    out = _doit(arglist)
  File "/usr/lib/pymodules/python2.7/univention/admincli/admin.py", line 744, in _doit
    dn = object.create()
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 381, in create
    dn = self._create(response=response, serverctrls=serverctrls)
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 996, in _create
    al.extend(self._ldap_modlist())
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/networks/network.py", line 265, in _ldap_modlist
    self.sort_ipranges()
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/networks/network.py", line 305, in sort_ipranges
    if ipaddr.IPAddress(self['ipRange'][i][0]) < ipaddr.IPAddress(self['ipRange'][i - 1][0]):
  File "/usr/lib/python2.7/dist-packages/ipaddr.py", line 478, in __lt__
    str(self), str(other)))
TypeError: ::1 and 10.200.27.2 are not of the same version
Comment 2 Florian Best univentionstaff 2017-10-27 14:39:24 CEST
Patch: fbest/29571-network-with-mixed-ipv4-and-ipv6
Comment 3 Florian Best univentionstaff 2020-06-22 16:17:44 CEST
UCS 5.0:

# udm networks/network create --set name=network1 --set network=10.200.27.0 --set netmask=24 --append ipRange="10.200.27.2 10.200.27.200" --append ipRange="::1 ::2"
Traceback (most recent call last):
  File "/usr/share/univention-directory-manager-tools/univention-cli-server", line 223, in doit
    output = univention.admincli.admin.doit(arglist)
  File "/usr/lib/python3/dist-packages/univention/admincli/admin.py", line 396, in doit
    out = _doit(arglist)
  File "/usr/lib/python3/dist-packages/univention/admincli/admin.py", line 664, in _doit
    out.extend(cli.create(input, append, ignore_exists, parsed_options, parsed_append_options, parsed_remove_options, policy_reference))
  File "/usr/lib/python3/dist-packages/univention/admincli/admin.py", line 692, in create
    return self._create(self.module_name, self.module, self.dn, self.lo, self.position, self.superordinate, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/univention/admincli/admin.py", line 745, in _create
    dn = object.create()
  File "/usr/lib/python3/dist-packages/univention/admin/handlers/__init__.py", line 570, in create
    dn = self._create(response=response, serverctrls=serverctrls)
  File "/usr/lib/python3/dist-packages/univention/admin/handlers/__init__.py", line 1250, in _create
    al.extend(self._ldap_modlist())
  File "/usr/lib/python3/dist-packages/univention/admin/handlers/networks/network.py", line 246, in _ldap_modlist
    self.sort_ipranges()
  File "/usr/lib/python3/dist-packages/univention/admin/handlers/networks/network.py", line 287, in sort_ipranges
    if ipaddress.ip_address(u'%s' % self['ipRange'][i][0]) < ipaddress.ip_address(u'%s' % self['ipRange'][i - 1][0]):
  File "/usr/lib/python3.7/ipaddress.py", line 565, in __lt__
    self, other))
TypeError: ::1 and 10.200.27.2 are not of the same version
Comment 4 Florian Best univentionstaff 2022-03-10 14:07:47 CET
Already part of UCS 5.0 via git:5434e7344ddde945b8ba7df140575a4e362dae8d.