DHCP hostname change.
authorEric Price <ecprice@mit.edu>
Mon, 29 Oct 2007 05:20:29 +0000 (01:20 -0400)
committerEric Price <ecprice@mit.edu>
Mon, 29 Oct 2007 05:20:29 +0000 (01:20 -0400)
svn path=/trunk/dhcp/; revision=230

dhcpserver.py

index 6171843..8f4a129 100644 (file)
@@ -104,12 +104,12 @@ class DhcpBackend:
         Log.Output(Log.debug,"dhcp_backend : Discover ")
         chaddr = hwmac(packet.GetHardwareAddress())
         nic = self.findNIC(str(chaddr))
-        if nic is None:
+        if nic is None or nic.machine is None:
             return False
         ip = nic.ip
         if ip is None:  #Deactivated?
             return False
-        hostname = nic.hostname
+        hostname = nic.machine.name
         if hostname is not None:
             hostname += ".servers.csail.mit.edu"
         if ip is not None: