[Bro-Dev] #750: Patch adding IPv6 support for pysubnettree

Bro Tracker bro at tracker.bro-ids.org
Tue Jan 10 08:47:35 PST 2012

#750: Patch adding IPv6 support for pysubnettree
 Reporter:  robin         |      Owner:
     Type:  Patch         |     Status:  new
 Priority:  Normal        |  Milestone:  Bro2.1
Component:  pysubnettree  |    Version:
 Keywords:  ipv6          |
 The attached patch adds IPv6 support to pysubnettree from Henry Stern /

 Attached is a patch against pysubnetree 0.12 to add IPv6 support.
 I’ve updated the test cases appropriately.

 I managed to implement it with only one small change to the Python API.
 You had overloaded the __contains__ function to take both ascii and packed
 binary IPv4 addresses.  The assumption that 4-byte addresses are packed
 binary addresses fails when you process both IPv4 and IPv6 addresses
 because “1::2” is valid both as an ascii IPv6 address and a binary IPv4
 Packed IPv6 addresses face similar issues.  I solved this problem by
 an optional flag for the constructor “binary_lookup_mode,” and an
 accessor/mutator function for the same.

 Please review it and let me know what you think.

 Also, I noticed that some return values from system calls in patricia.c
 not checked.  This is a problem for another day, but really does need to
 be addressed because a failed calloc will cause a mysterious segfault.

Ticket URL: <http://tracker.bro-ids.org/bro/ticket/750>
Bro Tracker <http://tracker.bro-ids.org/bro>
Bro Issue Tracker

More information about the bro-dev mailing list