Changeset 4149 in genesis


Ignore:
Timestamp:
Mar 24, 2005, 3:30:10 PM (20 years ago)
Author:
lodewijk
Message:

herken andere netmasks dan /30

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nodes/getrange.py

    r3130 r4149  
    44import re
    55
    6 ipre = re.compile("^IP=(172\.16\.[0-9]+\.[0-9]+)/30 *")
     6ipre = re.compile("^IP=(172\.16\.[0-9]+\.[0-9]+)/([0-9]+) *")
    77
    88def parseaddr(s):
     
    2626                print "'" + l + "'"
    2727        addr = parseaddr(match.group(1))
    28         addr = addr & 0xfffffffcL
     28        mask = int(match.group(2))
     29        addr = addr & ~((1 << (32 - mask)) - 1)
    2930        bezet[addr] = 1
    3031
Note: See TracChangeset for help on using the changeset viewer.