summaryrefslogtreecommitdiffstats
path: root/etc/inc/interfaces.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-08-26 16:22:37 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-08-26 16:22:37 +0000
commit6d76590c938ceb623e21041af72add4fc77044c5 (patch)
tree43dd144761f5b00d8e9de83733368763d8644ede /etc/inc/interfaces.inc
parent5c990bf4657796d641c62bd2f29ed08e55846b15 (diff)
downloadpfsense-6d76590c938ceb623e21041af72add4fc77044c5.zip
pfsense-6d76590c938ceb623e21041af72add4fc77044c5.tar.gz
Even if a user doesn't fill in a hostname we really should run dhclient-script.
Doh! This is a bug on m0n0wall too.
Diffstat (limited to 'etc/inc/interfaces.inc')
-rw-r--r--etc/inc/interfaces.inc44
1 files changed, 29 insertions, 15 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index af6214e..4b1bf08 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -617,18 +617,23 @@ function interfaces_opt_dhcp_configure($interface) {
return 1;
}
+ if ($optcfg['dhcphostname']) {
+ $dhclientconf_hostname = "send dhcp-client-identifier \"{$optcfg['dhcphostname']}\";\n";
+ $dhclientconf_hostname = " send dhcp-client-identifier \"{$optcfg['dhcphostname']}\";\n";
+ } else {
+ $dhclientconf_hostname = "";
+ }
+
$dhclientconf = "";
- if ($optcfg['dhcphostname']) {
- $dhclientconf .= <<<EOD
- interface "{$optif}" {
- send dhcp-client-identifier "{$optcfg['dhcphostname']}";
+ $dhclientconf .= <<<EOD
+interface "{$optif}" {
send host-name "{$optcfg['dhcphostname']}";
script "/sbin/dhclient-script";
+ {$dhclientconf_hostname}
}
EOD;
- }
fwrite($fd, $dhclientconf);
fclose($fd);
@@ -647,6 +652,7 @@ function interfaces_dhcp_configure($interface) {
if(filter_translate_type_to_real_interface($interface) <> "")
$realinterface = filter_translate_type_to_real_interface($interface);
+
$optcfg = $config['interfaces'][$interface];
/* generate dhclient_$interface.conf */
@@ -656,18 +662,22 @@ function interfaces_dhcp_configure($interface) {
return 1;
}
+ if ($optcfg['dhcphostname']) {
+ $dhclientconf_hostname = "send dhcp-client-identifier \"{$optcfg['dhcphostname']}\";\n";
+ $dhclientconf_hostname = " send dhcp-client-identifier \"{$optcfg['dhcphostname']}\";\n";
+ } else {
+ $dhclientconf_hostname = "";
+ }
+
$dhclientconf = "";
- if ($optcfg['dhcphostname']) {
- $dhclientconf .= <<<EOD
+ $dhclientconf .= <<<EOD
interface "{$realinterface}" {
- send dhcp-client-identifier "{$optcfg['dhcphostname']}";
- send host-name "{$optcfg['dhcphostname']}";
script "/sbin/dhclient-script";
+ {$dhclientconf_hostname}
}
EOD;
- }
fwrite($fd, $dhclientconf);
fclose($fd);
@@ -698,19 +708,23 @@ function interfaces_wan_dhcp_configure() {
printf("Error: cannot open dhclient_wan.conf in interfaces_wan_dhcp_configure() for writing.\n");
return 1;
}
+
+ if ($wancfg['dhcphostname']) {
+ $dhclientconf_hostname = "send dhcp-client-identifier \"{$wancfg['dhcphostname']}\";\n";
+ $dhclientconf_hostname = " send dhcp-client-identifier \"{$wancfg['dhcphostname']}\";\n";
+ } else {
+ $dhclientconf_hostname = "";
+ }
$dhclientconf = "";
- if ($wancfg['dhcphostname']) {
- $dhclientconf .= <<<EOD
+ $dhclientconf .= <<<EOD
interface "{$wancfg['if']}" {
- send dhcp-client-identifier "{$wancfg['dhcphostname']}";
- send host-name "{$wancfg['dhcphostname']}";
script "/sbin/dhclient-script";
+ {$dhclientconf_hostname}
}
EOD;
- }
fwrite($fd, $dhclientconf);
fclose($fd);
OpenPOWER on IntegriCloud