--- services.inc.save   2009-12-17 15:02:58.000000000 -0500
+++ services.inc        2009-12-17 15:23:09.000000000 -0500
@@ -281,7 +281,9 @@
                        }
                }
 
+               // tftp-server-name
+               if ($dhcpifconf['tftp'] <> "")
+                       $dhcpdconf .= " option tftp-server-name \"{$dhcpifconf['tftp']}\";\n";
 
                $dhcpdconf .= <<<EOD
 }

--- services_dhcp.php.save      2009-12-17 15:07:31.000000000 -0500
+++ services_dhcp.php   2009-12-17 15:20:59.000000000 -0500
@@ -129,6 +129,7 @@
 $pconfig['filename'] = $config['dhcpd'][$if]['filename'];
 $pconfig['failover_peerip'] = $config['dhcpd'][$if]['failover_peerip'];
 $pconfig['netmask'] = $config['dhcpd'][$if]['netmask'];
+$pconfig['tftp'] = $config['dhcpd'][$if]['tftp'];
 
 $ifcfg = $config['interfaces'][$if];
 
@@ -214,7 +215,8 @@
                if (($_POST['nextserver'] && !is_ipaddr($_POST['nextserver']))) {
                        $input_errors[] = "A valid IP address must be specified for the network boot server.";
                }
-
+               if (($_POST['tftp'] && !is_ipaddr($_POST['tftp'])))
+                           $input_errors[] = "A valid IP address must be specified for the TFTP server.";
 
                if (!$input_errors) {
                        /* make sure the range lies within the current subnet */
@@ -275,6 +277,7 @@
                $config['dhcpd'][$if]['netboot'] = ($_POST['netboot']) ? true : false;
                $config['dhcpd'][$if]['next-server'] = $_POST['nextserver'];
                $config['dhcpd'][$if]['filename'] = $_POST['filename'];
+                $config['dhcpd'][$if]['tftp'] = $_POST['tftp'];
 
                write_config();
 
@@ -355,6 +358,7 @@
        document.iform.nextserver.disabled = endis;
        document.iform.filename.disabled = endis;
        document.iform.denyunknown.disabled = endis;
+       document.iform.tftp.disabled = endis;
 }
 
 function show_ddns_config() {
@@ -369,6 +373,12 @@
        aodiv.style.display = "block";
 }
 
+function show_tftp_config() {
+        document.getElementById("showtftpbox").innerHTML='';
+        aodiv = document.getElementById('showtftp');
+        aodiv.style.display = "block";
+}
+
 function show_netboot_config() {
        document.getElementById("shownetbootbox").innerHTML='';
        aodiv = document.getElementById('shownetboot');
@@ -567,8 +577,20 @@
                                        Enter the dynamic DNS domain which will be used to register client names in the DNS server.
                                </div>
                        </td>
-                     </tr>
-                      <tr>
+                       </tr>
+                        <tr>
+                       <td width="22%" valign="top" class="vncell">TFTP server</td>
+                       <td width="78%" class="vtable">
+                                <div id="showtftpbox">
+                                        <input type="button" onClick="show_tftp_config()" value="Advanced"></input> - Show TFTP configuration</a>
+                                </div>
+                                <div id="showtftp" style="display:none">
+                                        <input name="tftp" type="text" class="formfld unknown" id="tftp" size="50" value="<?=htmlspecialchars($pconfig['tftp']);?>"><br>
+                                        Leave blank to disable.  Enter a full hostname or IP for the TFTP server.
+                                </div>
+                        </td>
+                        </tr>
+                       <tr>
                         <td width="22%" valign="top" class="vncell">NTP servers</td>
                         <td width="78%" class="vtable">
                                <div id="showntpbox">