Bug #27294

IPv6 Support for $TYPO3_CONF_VARS['FE']['IPmaskMountGroups'] broken

Added by Franz Vinzenz over 10 years ago. Updated about 7 years ago.

Should have
Target version:
Start date:
Due date:
% Done:


Estimated time:
TYPO3 Version:
PHP Version:
Is Regression:
Sprint Focus:


In the File t3lib\class.t3lib_div.php on Line 802 in the function cmpIPv6($baseIP, $list) doesnt work correct.

There are 2 Problems.
1. ) There are only /48 and /64 Masks supported.
2.) It seems the function IPv6Hex2Bin doesnt work correct in conjunction with the substr. I think the third parameter is incorrect, as it means bytes instead of Bits.

My suggestion is instead oft he case to calculate the length oft he strings from the mask.

To support flexible Masks , instead of the function baseIPBin there schuold be used a function wich returns a String representation of the bits in zhe address. (string length = 128). so the substring function can use the value fo the mask.

In my opinion the call of self::IPv6Hex2Bin an be replaced with str_replace.

the followin code sequence could replace the entire
switch ($mask) { // test on /48 /64
block in the File t3lib\class.t3lib_div.php on Line 802 in the function cmpIPv6($baseIP, $list)

if ($mask % 4) {
$success = FALSE;
} else {
$testBin = substr(str_replace(':', '', $test), 0, $mask / 4);
$baseIPBin = substr(str_replace(':', '', $baseIP), 0, $mask / 4);
$success = strcmp($testBin, $baseIPBin) == 0 ? TRUE : FALSE;

Related issues

Related to TYPO3 Core - Bug #27210: t3lib_div::cmpIPv6() fails to compareClosedStefan Neufeind2011-06-04


Updated by Alexander Opitz over 7 years ago

  • Status changed from New to Needs Feedback
  • Is Regression set to No


as this issue is very old. Does the problem still exists within newer versions of TYPO3 CMS (4.5.35 or 6.2.4)?


Updated by Alexander Opitz about 7 years ago

  • Status changed from Needs Feedback to Closed

No feedback within the last 90 days => closing this issue.

If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.

Also available in: Atom PDF