From ca88dded01b5be3ea07769c2f9518f01fb88cba8 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Tue, 9 Oct 2007 21:48:44 +0000 Subject: MFC 19653 19654 19655 Check if interface is passed along, otherwise return Do not reconfigure on pptp interfaces. Do not reconfigure on pptp interfaces. --- etc/rc.linkup | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'etc/rc.linkup') diff --git a/etc/rc.linkup b/etc/rc.linkup index 523bd9b..6c86190 100755 --- a/etc/rc.linkup +++ b/etc/rc.linkup @@ -46,36 +46,44 @@ } function handle_argument_group($argument1, $argument2) { - global $config; + global $config; log_error("Processing {$argument1} - {$argument2}"); $iface = convert_real_interface_to_friendly_interface_name($argument1); - if(!$iface) + if($iface == "") { + log_error("Not a valid interface \"$iface\""); return; + } + if($argument2 == "") { + log_error("Not a valid interface action \"$argument2\""); + return; + } if($config['interfaces'][$iface]['ipaddr'] <> "dhcp" and $config['interfaces'][$iface]['ipaddr'] <> "pppoe" and $config['interfaces'][$iface]['ipaddr'] <> "bigpond" and $config['interfaces'][$iface]['ipaddr'] <> "pptp") { log_error("Hotplug event detected for {$argument1} but ignoring since interface is not set for DHCP"); + exec("/usr/sbin/arp -d -i {$argument1} -a"); } else { - switch ($argument1) { + switch ($argument2) { case "stop": case "down": log_error("DEVD Ethernet detached event for {$argument1}"); exec("/sbin/ifconfig {$argument1} delete"); - exec("/usr/sbin/arp -da"); + exec("/usr/sbin/arp -d -i {$argument1} -a"); exit; break; /* LINT - NOT REACHED */ case "start": case "up": log_error("DEVD Ethernet attached event for {$argument1}"); exec("/sbin/ifconfig {$argument1} up"); - exec("/usr/sbin/arp -da"); + exec("/usr/sbin/arp -d -i {$argument1} -a"); break; } switch ($iface) { case "wan": - if($config['interfaces'][$iface]['ipaddr'] <> "pppoe") { - /* do not reconfigure on hotplug events when using pppoe */ + if($config['interfaces'][$iface]['ipaddr'] <> "pppoe" and + $config['interfaces'][$iface]['ipaddr'] <> "pptp") { + /* do not reconfigure on hotplug events when using pppoe or pptp */ log_error("HOTPLUG: Configuring wan interface {$argument1}"); interfaces_wan_configure(); } -- cgit v1.1