Menu

#405 Visual subnet display doesn't work

1.2
open
nobody
None
1
2016-07-28
2016-04-07
Anonymous
No

Hi,

The features 'Visual subnet display' doen't work every time...
Sometimes, the display is ok, sometimes the features display anything... I don't understand why...

Discussion

  • Anonymous

    Anonymous - 2016-04-07

    I do a "verify database" everything is fine.

    Here screenshoot :
    Heberger image

     
  • Anonymous

    Anonymous - 2016-04-07

    Hebergeur d'image

     
  • Miha Petkovsek

    Miha Petkovsek - 2016-06-28

    32 bit system ?

     
  • Matthias Becher

    Matthias Becher - 2016-07-28

    I had the same problem on Windows Server 2012 r2. Its a 64bit system.
    The problem is in the file app/subnets/subnet-visual.php
    On line 9 and 10 there is an typecast to INT. On Windows systems INT-values are php-internal max 32bit signed.
    To solve the problem remove these two typecasts. The gmp_and() function dont need the value as INT, it understands the string input too.

    Original line 9 and 10:

    $start_visual = gmp_strval(gmp_and("0xffffffff", (int) $Subnets->transform_to_decimal($subnet_detailed['network'])));
    
    $stop_visual  = gmp_strval(gmp_and("0xffffffff", (int) $Subnets->transform_to_decimal($subnet_detailed['broadcast'])));
    

    Working line 9 and 10

    $start_visual = gmp_strval(gmp_and("0xffffffff", $Subnets->transform_to_decimal($subnet_detailed['network'])));
    
    $stop_visual  = gmp_strval(gmp_and("0xffffffff", $Subnets->transform_to_decimal($subnet_detailed['broadcast'])));
    

    For all Windows-Users it would be nice to solve this Problem in the next version ;)

    PS:
    Why it sometimes works and sometimes not:
    IPs lower than 128.0.0.0 fit into an 32bit signed value. So they are calculated right and the visual display works fine. With larger IPs the visual display dont work.

    Matthias Becher

     

    Last edit: Matthias Becher 2016-07-28

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.