View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
585 | RackTables | default | public | 2012-07-18 09:12 | 2012-07-31 20:53 |
Reporter | malayamanas | Assigned To | andriyanov | ||
Priority | high | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | x86 | OS | Centos | OS Version | 5.5 |
Product Version | 0.20.0 | ||||
Target Version | 0.20.0 | Fixed in Version | 0.20.0 | ||
Summary | 585: New IPv4 address space is 127.0.0.0 instead of submitted value | ||||
Description | What ever IPV4 Address space is given, it creates an address space of loopback 127.0.0.0 range | ||||
Steps To Reproduce | Just checkout from svn trunk and setup apache,mysql. Add an IPV4 address space, it will create an address space starting from 127. range. It is not happening in 0.19.3 version. | ||||
Tags | No tags attached. | ||||
It is not happening in 0.19.13 version. | |
Is there any update ? | |
Can you provide the HTTP request dump with form parameters' values? Some kind of browser debugger could be used (e.g. FireBug). Maybe your browser sends 127.0.0.0 to the server. |
|
I can confirm that in database it stores the IP range value correctly. It may be the issue with displaying it after the addition. mysql> SELECT ip, INET_NTOA(ip), mask FROM IPv4Network; +-----------+---------------+------+ | ip | INET_NTOA(ip) | mask | +-----------+---------------+------+ | 2886737408| 172.16.30.0 | 24 | +-----------+---------------+------+ Please check. |
|
This issue may be associated with inc/database.php | |
|
|
Uploaded screen shot from live-http-header firefox extension. | |
Please run the attached PHP script and post its output. Your current directory should contain wwwroot/inc dir. | |
I ran the test.php and the out come is mentioned below. ip = 172.16.30.0 ip_bin = ac101e0 net['ip'] = 127.255.255.0 net['ip_bin'] = 7fffff0 ip4_format() = 127.255.255.0 |
|
Hmm, looks very strange. Please grab some more diagnostics by typing these 3 commands: # echo "show create table IPv4Network\G" | mysql racktables # cat <<\END >test2.php <?php $script_mode = TRUE; require 'wwwroot/inc/init.php'; $row = fetchIPv4AddressNetworkRow (ip_parse ('172.16.30.0')); var_dump ($row); echo ip_format (ip4_int2bin ($row['ip'])) . "\n"; END # php test2.php |
|
TEST#1 =================== *************************** 1. row *************************** Table: IPv4Network Create Table: CREATE TABLE `IPv4Network` ( `id` int(10) unsigned NOT NULL auto_increment, `ip` int(10) unsigned NOT NULL default '0', `mask` int(10) unsigned NOT NULL default '0', `name` char(255) default NULL, `comment` text, PRIMARY KEY (`id`), UNIQUE KEY `base-len` (`ip`,`mask`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ============================================================================== TEST#2 =============================================================================== array(5) { ["id"]=> string(2) "13" ["ip"]=> string(10) "2886737408" ["mask"]=> string(2) "24" ["name"]=> string(7) "pool-30" ["comment"]=> NULL } 127.255.255.255 ========================================================================== |
|
THIS IS FROM 0.20.0 DB OUTPUT FROM echo "show create table IPv4Network\G" | mysql racktables20 [root@localhost wwwroot]# echo "show create table IPv4Network\G" | mysql racktables20 *************************** 1. row *************************** Table: IPv4Network Create Table: CREATE TABLE `IPv4Network` ( `id` int(10) unsigned NOT NULL auto_increment, `ip` int(10) unsigned NOT NULL default '0', `mask` int(10) unsigned NOT NULL default '0', `name` char(255) default NULL, `comment` text, PRIMARY KEY (`id`), UNIQUE KEY `base-len` (`ip`,`mask`) ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 ====================================================== ====================================================== THIS IS FROM 0.19.13 DB OUTPUT FROM echo "show create table IPv4Network\G" | mysql racktables [root@localhost wwwroot]# echo "show create table IPv4Network\G" | mysql racktables *************************** 1. row *************************** Table: IPv4Network Create Table: CREATE TABLE `IPv4Network` ( `id` int(10) unsigned NOT NULL auto_increment, `ip` int(10) unsigned NOT NULL default '0', `mask` int(10) unsigned NOT NULL default '0', `name` char(255) default NULL, `comment` text, PRIMARY KEY (`id`), UNIQUE KEY `base-len` (`ip`,`mask`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 Difference is AUTO_INCREMENT value in both versions of the DB schema. |
|
From inc/functions.php function ip4_int2bin ($ip_int) //expects an integer as parameter. { return pack ('N', $ip_int); } But $row['ip'] is an array of string, which is passed to above function. |
|
SOLVED by doing below change in wwwroot/inc/function.php function ip4_int2bin ($ip_int) { return pack ('N', (double)$ip_int); } Added a double type casting. int casting is out of range. Please check for IPv6. May be 64 bit OS required. |
|
I've made a fix: https://github.com/RackTables/racktables/commit/5a8bd9a372ca6a371f718c5eb369aef487335e70 Hope it will work for you, please check it out (we've moved project from SVN to git) |
|
Fixed | |
Date Modified | Username | Field | Change |
---|---|---|---|
2012-07-18 09:12 | malayamanas | New Issue | |
2012-07-18 09:16 | malayamanas | Note Added: 0000708 | |
2012-07-18 21:38 | infrastation | Assigned To | => andriyanov |
2012-07-18 21:38 | infrastation | Status | new => assigned |
2012-07-26 09:01 | malayamanas | Note Added: 0000715 | |
2012-07-26 09:11 | andriyanov | Note Added: 0000716 | |
2012-07-30 13:47 | malayamanas | Note Added: 0000718 | |
2012-07-30 14:13 | malayamanas | Note Added: 0000719 | |
2012-07-30 14:18 | malayamanas | File Added: live-http-header.PNG | |
2012-07-30 14:19 | malayamanas | Note Added: 0000720 | |
2012-07-30 21:54 | andriyanov | File Added: test.php | |
2012-07-30 21:55 | andriyanov | Note Added: 0000722 | |
2012-07-31 05:18 | adoom42 | Summary | It is on latest 0.20.0 version. from SVN trunk => New IPv4 address space is 127.0.0.0 instead of submitted value |
2012-07-31 07:13 | malayamanas | Note Added: 0000725 | |
2012-07-31 10:08 | andriyanov | Note Added: 0000726 | |
2012-07-31 10:17 | malayamanas | Note Added: 0000727 | |
2012-07-31 10:22 | malayamanas | Note Added: 0000728 | |
2012-07-31 11:02 | malayamanas | Note Added: 0000729 | |
2012-07-31 11:44 | malayamanas | Note Added: 0000730 | |
2012-07-31 11:50 | andriyanov | Note Added: 0000731 | |
2012-07-31 12:34 | malayamanas | Note Added: 0000732 | |
2012-07-31 12:34 | malayamanas | Status | assigned => closed |
2012-07-31 12:34 | malayamanas | Resolution | open => fixed |
2012-07-31 16:57 | adoom42 | Fixed in Version | => 0.19.14 |
2012-07-31 16:57 | adoom42 | Target Version | => 0.19.14 |
2012-07-31 17:22 | andriyanov | Product Version | 0.19.13 => development repository checkout |
2012-07-31 17:22 | andriyanov | Fixed in Version | 0.19.14 => development repository checkout |
2012-07-31 17:22 | andriyanov | Target Version | 0.19.14 => development repository checkout |
2012-07-31 20:53 | andriyanov | Product Version | development repository checkout => 0.20.0 |
2012-07-31 20:53 | andriyanov | Fixed in Version | development repository checkout => 0.20.0 |
2012-07-31 20:53 | andriyanov | Target Version | development repository checkout => 0.20.0 |