Changeset 377 for trunk/packages


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

Fix the DHCP server (fixes #44)

Location:
trunk/packages
Files:
3 added
6 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
  • trunk/packages/sipb-xen-python-pydhcplib/debian/changelog

    r361 r377  
     1sipb-xen-python-pydhcplib (0.3.2-2) unstable; urgency=low
     2
     3  * Add a patch to allow DHCP option 119 (domain-search) to work
     4
     5 -- SIPB Xen Project <sipb-xen@mit.edu>  Mon, 31 Mar 2008 19:33:13 -0400
     6
    17sipb-xen-python-pydhcplib (0.3.2-1) unstable; urgency=low
    28
  • trunk/packages/sipb-xen-python-pydhcplib/debian/control

    r361 r377  
    33Priority: extra
    44Maintainer: SIPB Xen Project <sipb-xen@mit.edu>
    5 Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 5), debhelper (>= 5.0.37.2), cdbs (>= 0.4.43), python-all-dev (>= 2.3.5-11), python-support (>= 0.3.2)
     5Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 5), quilt, patchutils (>= 0.2.25), cdbs (>= 0.4.27-1), debhelper (>= 5.0.37.2), cdbs (>= 0.4.43), python-all-dev (>= 2.3.5-11), python-support (>= 0.3.2)
    66Standards-Version: 3.7.2
    77
  • trunk/packages/sipb-xen-python-pydhcplib/debian/rules

    r361 r377  
    55
    66include /usr/share/cdbs/1/rules/debhelper.mk
     7include /usr/share/cdbs/1/rules/patchsys-quilt.mk
    78include /usr/share/cdbs/1/class/python-distutils.mk
Note: See TracChangeset for help on using the changeset viewer.