summaryrefslogtreecommitdiffstats
path: root/etc/rc.linkup
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-11-27 20:41:10 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-11-27 20:41:10 +0000
commitd7a6517a4bf23188d37dfa60d9314437275d6343 (patch)
tree74b2c5926940b32e0da46b470129aa4b1da357a0 /etc/rc.linkup
parent528df9a78e17a9c7acfddff1e3c50696e3a24228 (diff)
downloadpfsense-d7a6517a4bf23188d37dfa60d9314437275d6343.zip
pfsense-d7a6517a4bf23188d37dfa60d9314437275d6343.tar.gz
MFC 8080
* Do not process hotplug events from pppoe * Cleanup kill by pid function, accept a real pid (dhclient depends on this)
Diffstat (limited to 'etc/rc.linkup')
-rwxr-xr-xetc/rc.linkup88
1 files changed, 47 insertions, 41 deletions
diff --git a/etc/rc.linkup b/etc/rc.linkup
index 8a19d2a..480881c 100755
--- a/etc/rc.linkup
+++ b/etc/rc.linkup
@@ -34,47 +34,53 @@
require_once("config.inc");
require_once("functions.inc");
- if($g['booting'] == true)
- exit;
-
- $friendly_interface = convert_real_interface_to_friendly_interface_name($argv[1]);
- if($config['interfaces'][$friendly_interface]['ipaddr'] <> "dhcp" and
- $config['interfaces'][$friendly_interface]['ipaddr'] <> "pppoe" and
- $config['interfaces'][$friendly_interface]['ipaddr'] <> "bigpond" and
- $config['interfaces'][$friendly_interface]['ipaddr'] <> "pptp") {
- log_error("Hotplug event detected for {$argv[1]} but ignoring since interface is not set for DHCP");
- exit;
- }
-
- if($argv[2] == "stop" or $argv[2] == "down") {
- log_error("DEVD Ethernet detached event for {$argv[1]}");
- exec("/sbin/ifconfig {$argv[1]} delete");
- exec("/usr/sbin/arp -da");
- exit;
- }
-
- if($argv[2] == "start" or $argv[2] == "up") {
- log_error("DEVD Ethernet attached event for {$argv[1]}");
- exec("/sbin/ifconfig {$argv[1]} up");
- exec("/usr/sbin/arp -da");
- }
-
- if($argv[1] <> "") {
- $interface = convert_real_interface_to_friendly_interface_name($argv[1]);
- } else {
- log_error("WARNING: No interface passed to rc.linkup");
- $interface = "wan";
- }
-
- if($interface == "wan") {
- log_error("HOTPLUG: Configuring wan interface {$interface}");
- interfaces_wan_configure();
- } else if($interface == "lan") {
- log_error("HOTPLUG: Configuring lan interface {$interface}");
- interfaces_lan_configure();
+ if($g['booting'] == true) {
+ /* ignore all linkup events */
} else {
- log_error("HOTPLUG: Configuring optional interface {$interface}");
- interfaces_optional_configure_if($interface);
+
+ $friendly_interface = convert_real_interface_to_friendly_interface_name($argv[1]);
+ if($config['interfaces'][$friendly_interface]['ipaddr'] <> "dhcp" and
+ $config['interfaces'][$friendly_interface]['ipaddr'] <> "pppoe" and
+ $config['interfaces'][$friendly_interface]['ipaddr'] <> "bigpond" and
+ $config['interfaces'][$friendly_interface]['ipaddr'] <> "pptp") {
+ log_error("Hotplug event detected for {$argv[1]} but ignoring since interface is not set for DHCP");
+ exit;
+ }
+
+ if($argv[2] == "stop" or $argv[2] == "down") {
+ log_error("DEVD Ethernet detached event for {$argv[1]}");
+ exec("/sbin/ifconfig {$argv[1]} delete");
+ exec("/usr/sbin/arp -da");
+ exit;
+ }
+
+ if($argv[2] == "start" or $argv[2] == "up") {
+ log_error("DEVD Ethernet attached event for {$argv[1]}");
+ exec("/sbin/ifconfig {$argv[1]} up");
+ exec("/usr/sbin/arp -da");
+ }
+
+ if($argv[1] <> "") {
+ $interface = convert_real_interface_to_friendly_interface_name($argv[1]);
+ } else {
+ log_error("WARNING: No interface passed to rc.linkup");
+ $interface = "wan";
+ }
+
+ if($interface == "wan") {
+ if($config['interfaces'][$friendly_interface]['ipaddr'] <> "pppoe") {
+ /* do not reconfigure on hotplug events when using pppoe */
+ log_error("HOTPLUG: Configuring wan interface {$interface}");
+ interfaces_wan_configure();
+ }
+ } else if($interface == "lan") {
+ log_error("HOTPLUG: Configuring lan interface {$interface}");
+ interfaces_lan_configure();
+ } else {
+ log_error("HOTPLUG: Configuring optional interface {$interface}");
+ interfaces_optional_configure_if($interface);
+ }
+
}
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud