Changeset 1252


Ignore:
Timestamp:
12/19/06 13:53:54 (6 years ago)
Author:
mglb1
Message:

Remove silly assumption in the DHCP code that assumed every link that DHCP
was configured on as a /24.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ccsd/private/modules/ccs_dhcp.py

    r1135 r1252  
    140140            raise dhcp_error("DHCP already enabled on interface!") 
    141141         
    142         # Try and setup a default pool from 129 -> 253 
    143142        link = getInterfaceLink(self._session_id, interface_id) 
    144         pool_max = link._maxIP(True) 
    145         pool_min = link._minIP(True, 128) 
     143        length = cidrToLength(link["network_address"]) 
     144        if length == 24: 
     145            # Try and setup a default pool from 129 -> 253 
     146            pool_max = link._maxIP(True) 
     147            pool_min = link._minIP(True, 128) 
     148        else: 
     149            # Try and setup a default pool using the whole range 
     150            pool_max = link._maxIP(True) 
     151            pool_min = link._minIP(True) 
    146152        # Check all IPs in the pool are free 
    147153        ip = ipnum(pool_min) 
Note: See TracChangeset for help on using the changeset viewer.