From 1b3fb20f68b3efe2e232a49dfcdcd101b9e81b2a Mon Sep 17 00:00:00 2001 Message-Id: <1b3fb20f68b3efe2e232a49dfcdcd101b9e81b2a.1353429655.git.hahn@univention.de> From: Philipp Hahn Date: Tue, 20 Nov 2012 17:37:10 +0100 Subject: [PATCH] Bug #29216: Fix get_default_netmask() to return prefix length Organization: Univention GmbH, Bremen, Germany ipaddr.IPv6 does not like using netmask, but expects the prefix length. The result of get_default_netmask() is always passed to either univention-ipcal6 or udm-network/network, which both work with prefix length. Rename get_default_netmask to get_default_netprefix. Return network prefix length instead of netmask. --- .../ucs/base/univention-lib/debian/changelog | 25 ++++++++++++------- .../ucs-3.1/ucs/base/univention-lib/shell/base.sh | 7 +++-- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/branches/ucs-3.1/ucs/base/univention-lib/debian/changelog b/branches/ucs-3.1/ucs/base/univention-lib/debian/changelog index 453f9e7..1528127 100644 --- a/branches/ucs-3.1/ucs/base/univention-lib/debian/changelog +++ b/branches/ucs-3.1/ucs/base/univention-lib/debian/changelog @@ -1,3 +1,10 @@ +univention-lib (2.0.16-1) unstable; urgency=low + + * Rename get_default_netmask to get_default_netprefix and return network + prefix length instead of netmask (Bug #29216) + + -- Philipp Hahn Tue, 20 Nov 2012 17:34:43 +0100 + univention-lib (2.0.15-1) unstable; urgency=low * Add low-level log support for package_manager (Bug #29037) @@ -184,14 +191,14 @@ univention-lib (1.0.72-1) unstable; urgency=low univention-lib (1.0.71-2) unstable; urgency=low - * fixed build dep (Bug #26536) + * fixed build dep (Bug #26536) -- Felix Botner Mon, 16 Apr 2012 09:59:38 +0200 univention-lib (1.0.71-1) unstable; urgency=low * added description for listener/shares/rename and - listener/shares/rename/fstypes (Bug #26536) + listener/shares/rename/fstypes (Bug #26536) -- Felix Botner Mon, 16 Apr 2012 09:51:47 +0200 @@ -203,7 +210,7 @@ univention-lib (1.0.70-1) unstable; urgency=low univention-lib (1.0.45-1) unstable; urgency=low - * fixed python/listenerSharePath.py (Bug #26025) + * fixed python/listenerSharePath.py (Bug #26025) -- Felix Botner Thu, 23 Feb 2012 11:10:14 +0100 @@ -215,13 +222,13 @@ univention-lib (1.0.44-1) unstable; urgency=low univention-lib (1.0.43-1) unstable; urgency=low - * added python lib to rename directories (Bug #26025) + * added python lib to rename directories (Bug #26025) -- Felix Botner Fri, 03 Feb 2012 14:29:30 +0100 univention-lib (1.0.42-1) unstable; urgency=low - * fixed ldap search filter in getMailFromMailOrUid.py (Bug #23739) + * fixed ldap search filter in getMailFromMailOrUid.py (Bug #23739) -- Felix Botner Thu, 24 Nov 2011 09:36:08 +0100 @@ -245,7 +252,7 @@ univention-lib (1.0.39-1) unstable; urgency=low univention-lib (1.0.38-1) unstable; urgency=low - * escape ldap filter in python/getMailFromMailOrUid.py (Bug #23739) + * escape ldap filter in python/getMailFromMailOrUid.py (Bug #23739) -- Felix Botner Tue, 08 Nov 2011 08:54:44 +0100 @@ -258,7 +265,7 @@ univention-lib (1.0.37-1) unstable; urgency=low univention-lib (1.0.36-1) unstable; urgency=low - * shell/umc.sh: added check whether UMC frontend is installed for + * shell/umc.sh: added check whether UMC frontend is installed for umc_frontend_new_hash (Bug #22881) -- Alexander Kläser Wed, 02 Nov 2011 17:14:31 +0100 @@ -308,7 +315,7 @@ univention-lib (1.0.30-1) unstable; urgency=low univention-lib (1.0.29-1) unstable; urgency=low - * added logrotate/notifempty to ucrLogrotate helper (Bug #18002) + * added logrotate/notifempty to ucrLogrotate helper (Bug #18002) -- Felix Botner Wed, 12 Oct 2011 12:38:59 +0200 @@ -332,7 +339,7 @@ univention-lib (1.0.26-1) unstable; urgency=low univention-lib (1.0.25-1) unstable; urgency=low - * added python/ucrLogrotate.py (Bug #18002) + * added python/ucrLogrotate.py (Bug #18002) -- Felix Botner Tue, 11 Oct 2011 15:41:41 +0200 diff --git a/branches/ucs-3.1/ucs/base/univention-lib/shell/base.sh b/branches/ucs-3.1/ucs/base/univention-lib/shell/base.sh index dce84a0..2a70a49 100644 --- a/branches/ucs-3.1/ucs/base/univention-lib/shell/base.sh +++ b/branches/ucs-3.1/ucs/base/univention-lib/shell/base.sh @@ -139,11 +139,12 @@ get_default_ipv6_address () { } # -# returns the default netmask +# returns the default network prefix length # -get_default_netmask () { +get_default_netmask () { get_default_netprefix "$@"; } # deprecated, will be removed soon +get_default_netprefix () { PYTHONPATH=/usr/lib/pymodules/python2.6/univention/config_registry python2.6 2>/dev/null \ - -c 'from interfaces import Interfaces;print Interfaces().get_default_ip_address().netmask' + -c 'from interfaces import Interfaces;print Interfaces().get_default_ip_address().prefixlen' } # -- 1.7.1