View Issue Details

IDProjectCategoryView StatusLast Update
695RackTablesIPv4/IPv6/SLBpublic2012-12-17 07:01
Reporterfrankiehung Assigned Toandriyanov  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionduplicate 
PlatformLinuxOSDebian x86_64OS VersionV5.0.4
Product Version0.20.1 
Summary695: Add IPV4 space error
Descriptionadd prefix 192.168.1.8/30 with name Heartbeat IP is ok,
But from Browse show prefix is 255.255.255.252/32 ,
This setting on Version 0.19.14 is ok.
Please see attache file
TagsNo tags attached.

Relationships

duplicate of 643 closedandriyanov New Subnet is added wrong 

Activities

frankiehung

frankiehung

2012-12-10 10:21

reporter  

racktables.zip (159,978 bytes)
andriyanov

andriyanov

2012-12-10 16:10

reporter   ~0001027

I believe the issue is a duplicate of this bug:
http://bugs.racktables.org/view.php?id=643

Please apply the patch posted there and confirm.
frankiehung

frankiehung

2012-12-11 03:23

reporter   ~0001029

Last edited: 2012-12-11 03:24

use ID 0000643 Notes 0000903
Seems that your PHP version is returning a negative integer from
unpack ('N', "4byt"), which is terribly wrong.

Please try this patch: does it help?

diff --git a/wwwroot/inc/functions.php b/wwwroot/inc/functions.php
index b4f07ef..815695b 100644
--- a/wwwroot/inc/functions.php
+++ b/wwwroot/inc/functions.php
@@ -2229,8 +2229,10 @@ function ip4_bin2int ($ip_bin)
 {
        if (4 != strlen ($ip_bin))
                throw new InvalidArgException ('ip_bin', $ip_bin, "Invalid binary IP");
- $list = unpack ('N', $ip_bin);
- return array_shift ($list);
+ $ret = array_first (unpack ('N', $ip_bin));
+ if (PHP_INT_SIZE > 4 && $ret < 0)
+ $ret = $ret & 0xffffffff;
+ return $ret;
 }

This patch can work.
Thank you !

Issue History

Date Modified Username Field Change
2012-12-10 10:21 frankiehung New Issue
2012-12-10 10:21 frankiehung Status new => assigned
2012-12-10 10:21 frankiehung Assigned To => andriyanov
2012-12-10 10:21 frankiehung File Added: racktables.zip
2012-12-10 16:10 andriyanov Note Added: 0001027
2012-12-10 16:10 andriyanov Resolution open => duplicate
2012-12-11 03:23 frankiehung Note Added: 0001029
2012-12-11 03:24 frankiehung Note Edited: 0001029
2012-12-15 17:03 andriyanov Status assigned => closed
2012-12-17 07:01 infrastation Relationship added duplicate of 643