Ignore:
Timestamp:
Mar 31, 2008, 7:47:09 PM (17 years ago)
Author:
broder
Message:

Fix the DHCP server (fixes #44)

Location:
trunk/packages/sipb-xen-dhcp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-dhcp/code/dhcpserver.py

    r361 r377  
    2323                'router': '18.181.0.1',
    2424                'domain_name_server': '18.70.0.160,18.71.0.151,18.72.0.3',
    25                 'domain_name': 'mit.edu',
    2625                'ip_address_lease_time': 60*60*24}
    2726
     
    9695            elif option_type == "string" :
    9796                options[parameter] = strlist(value).list()
     97           
     98            elif option_type == "RFC3397" :
     99                parsed_value = ""
     100                for item in value:
     101                    components = item.split('.')
     102                    item_fmt = "".join(chr(len(elt)) + elt for elt in components) + "\x00"
     103                    parsed_value += item_fmt
    98104               
     105                options[parameter] = strlist(parsed_value).list()
     106           
    99107            else :
    100108                options[parameter] = strlist(value).list()
     
    110118        if ip is None:  #Deactivated?
    111119            return False
     120
     121        options = {}
    112122        if nic.hostname and '.' in nic.hostname:
    113             hostname = nic.hostname
     123            options['host_name'], options['domain_name'] = nic.hostname.split('.', 1)
    114124        elif nic.machine.name:
    115             hostname = nic.machine.name + '.servers.csail.mit.edu'
     125            options['host_name'] = nic.machine.name
     126            options['domain_name'] = 'servers.csail.mit.edu'
    116127        else:
    117128            hostname = None
     129        if DhcpOptions['domain_search'] in packet.GetOption('parameter_request_list'):
     130            options['host_name'] += '.' + options['domain_name']
     131            del options['domain_name']
     132            options['domain_search'] = ['mit.edu']
    118133        if ip is not None:
    119134            ip = ipv4(ip)
    120135            Log.Output(Log.debug,"dhcp_backend : Discover result = "+str(ip))
    121             packet_parameters = self.getParameters(host_name=hostname)
     136            packet_parameters = self.getParameters(**options)
    122137
    123138            # FIXME: Other offer parameters go here
  • trunk/packages/sipb-xen-dhcp/debian/changelog

    r364 r377  
     1sipb-xen-dhcp (2) unstable; urgency=low
     2
     3  * DHCP server should send information to set correct information
     4    (fixes #44)
     5
     6 -- SIPB Xen Projet <sipb-xen@mit.edu>  Mon, 31 Mar 2008 19:43:00 -0400
     7
    18sipb-xen-dhcp (1.1) unstable; urgency=low
    29
  • trunk/packages/sipb-xen-dhcp/debian/control

    r361 r377  
    88Package: sipb-xen-dhcp
    99Architecture: all
    10 Depends: ${misc:Depends}, daemon, sipb-xen-database-common, sipb-xen-python-pydhcplib
     10Depends: ${misc:Depends}, daemon, sipb-xen-database-common, sipb-xen-python-pydhcplib (>= 0.3.2-2)
    1111Description: Install and enable the DHCP server
Note: See TracChangeset for help on using the changeset viewer.