Changeset 062b991


Ignore:
Timestamp:
Mar 7, 2010 8:02:15 AM (15 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
Children:
0b799e0
Parents:
dd3e38b
Message:

Fix netmask calculation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/experiment_control.py

    rdd3e38b r062b991  
    12671267                raise service_error(service_error.req,
    12681268                        "Cannot allocate IP addresses")
    1269             mask = 2
    1270             while 2 **mask < net_size:
    1271                 mask += 1
    1272 
    1273             netmask = ((2**32-1) ^ (mask**2 -1))
     1269            mask = ips.min_alloc
     1270            while mask < net_size:
     1271                mask *= 2
     1272
     1273            netmask = ((2**32-1) ^ (mask-1))
    12741274
    12751275            base += 1
Note: See TracChangeset for help on using the changeset viewer.