Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Nov 14, 2013

  1. Bugfix: current code computes the wrong netmask on some architectures.

    See example below, it prints all possible netmasks with the current code
    and fixed code. For network masks like 0xffffffe0, math.log(netmask, 2)
    returns 4.99999999 on some architectures, which rounded gives 4, which
    in turn leads to a netmask of 28 instead of the correct 27.
    
    See the repeated 31 and 28 in the netmasks below.
    
        >>> import math
        >>> import ctypes
        >>> [32 - int(math.log(ctypes.c_uint32(~(0xffffffff << i)).value + 1, 2)) for i in range(32)]
        [32, 31, 31, 29, 28, 28, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
        >>> [32 - int(round(math.log(ctypes.c_uint32(~(0xffffffff << i)).value + 1, 2), 1)) for i in range(32)]
        [32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
    authored November 14, 2013

Nov 01, 2013

  1. Fix set_netmask() handling of negative numbers.

    If the netmask happens to have the first bit set to 1, which is fairly common
    (think 255.255.255.0), struct.pack(...i...) will fail, as 'i' takes signed 32
    bit integers, and will refuse to take any integer >= 2^31.
    
    Example:
    >>> struct.pack("i", 2**31)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    struct.error: 'i' format requires -2147483648 <= number <= 2147483647
    >>> struct.pack("i", 2**31 - 1)
    '\0xff\0xff\0xff\0xf7'
    authored October 31, 2013

Dec 18, 2012

  1. Bumped version number

    authored December 17, 2012
  2. Added a call to SIOCGIFCONF when listing interfaces, to get subinterf…

    …aces
    authored December 17, 2012
  3. Added a __repr__ niceness to Interfaces

    authored December 17, 2012

Jan 19, 2010

  1. Added some classifiers to the python distro

    authored January 19, 2010
  2. Including debian packaging in the source distribution

    authored January 19, 2010
  3. Packaged for Debian

    authored January 18, 2010
  4. Including license and readme with python source distribution

    authored January 18, 2010
  5. Fixed formatting in readme file

    authored January 18, 2010
  6. Better description for the project

    authored January 18, 2010
  7. Added a license

    authored January 18, 2010
  8. gitignore file

    authored January 18, 2010

Jan 18, 2010

  1. Added setup.py

    authored January 18, 2010
  2. Added route sub-module import to the top level

    authored January 18, 2010
  3. Moved library into a subdirectory

    authored January 18, 2010
  4. Added a readme file

    authored January 18, 2010
  5. Initial commit

    authored January 18, 2010
Something went wrong with that request. Please try again.