From 3e662cb0b22c4c7277b30a134e85a6d535044f1e Mon Sep 17 00:00:00 2001 From: Ermal Date: Thu, 7 Jun 2012 08:51:16 +0000 Subject: Get rid of carpdev, it will never be --- etc/inc/filter.inc | 1 - etc/inc/interfaces.inc | 133 +---------------------------- etc/inc/pfsense-utils.inc | 1 - etc/inc/util.inc | 1 - etc/rc.banner | 3 - usr/local/www/carp_status.php | 8 -- usr/local/www/firewall_virtual_ip.php | 10 +-- usr/local/www/firewall_virtual_ip_edit.php | 31 +------ usr/local/www/interfaces.php | 14 +-- usr/local/www/xmlrpc.php | 3 - 10 files changed, 9 insertions(+), 196 deletions(-) diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 00ece84..be4fc7d 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -2557,7 +2557,6 @@ pass in on \${$oc['descr']} proto gre from any to any keep state label "allow PP EOD; break; case "dhcp": - case "carpdev-dhcp": $ipfrules .= << "" && $vip['interface'] <> $interface) - continue; - interface_carpdev_configure($vip); - break; } } if ($carp_setuped == true) @@ -1985,11 +1973,6 @@ function interface_reload_carps($cif) { sleep(1); interface_carp_configure($vip); break; - case "carpdev-dhcp": - interface_vip_bring_down($vip); - sleep(1); - interface_carpdev_configure($vip); - break; case "ipalias": interface_vip_bring_down($vip); sleep(1); @@ -2079,83 +2062,6 @@ function interface_carp_configure(&$vip) { return $vipif; } -function interface_carpdev_configure(&$vip) { - global $g; - - if ($vip['mode'] != "carpdev-dhcp") - return; - - if (empty($vip['interface'])) - return; - - $realif = get_real_interface($vip['interface']); - interfaces_bring_up($realif); - - /* - * ensure the interface containing the VIP really exists - * prevents a panic if the interface is missing or invalid - */ - if (!does_interface_exist($realif)) { - file_notice("CARP", sprintf(gettext("Interface specified for the virtual IP address %s does not exist. Skipping this VIP."), $vip['subnet']), "Firewall: Virtual IP", ""); - return; - } - - $vipif = "{$vip['interface']}_vip{$vip['vhid']}"; - if (does_interface_exist($vipif)) { - interface_bring_down($vipif); - } else { - $carpdevif = exec("/sbin/ifconfig carp create"); - mwexec("/sbin/ifconfig {$carpdevif} name {$vipif}"); - pfSense_ngctl_name("{$carpdevif}:", $vipif); - } - - $vip_password = $vip['password']; - $vip_password = str_replace(" ", "", $vip_password); - if ($vip['password'] != "") - $password = " pass \"" . $vip_password . "\""; - - - mwexec("/sbin/ifconfig {$vipif} carpdev {$realif} vhid {$vip['vhid']} advskew {$vip['advskew']} advbase {$vip['advbase']} {$password}"); - interfaces_bring_up($vipif); - - /* - * XXX: BIG HACK but carpdev needs ip services active - * before even starting something as dhclient. - * I do not know if this is a feature or a bug - * but better than track it make it work ;) . - */ - //$fakeiptouse = "10.254.254." . ($carp_instances_counter+1); - //$cmdchain->add("CarpDEV hack", "/sbin/ifconfig {$carpint} inet {$fakeiptouse}", false); - - /* generate dhclient_wan.conf */ - $fd = fopen("{$g['varetc_path']}/dhclient_{$vipif}.conf", "w"); - if ($fd) { - $dhclientconf = ""; - - $dhclientconf .= <<{$g['tmp_path']}/{$vipif}_output 2>{$g['tmp_path']}/{$vipif}_error_output", false); - } else { - log_error(sprintf(gettext("Error: cannot open dhclient_%s.conf in interface_carpdev_configure() for writing.%s"), $vipif, "\n")); - mwexec("/sbin/dhclient -b {$vipif}"); - } - - return $vipif; -} - function interface_wireless_clone($realif, $wlcfg) { global $config, $g; /* Check to see if interface has been cloned as of yet. @@ -2872,9 +2778,6 @@ function interface_configure($interface = "wan", $reloadall = false, $linkupeven unset($interface_snv6_arr_cache[$realif]); switch ($wancfg['ipaddr']) { - case 'carpdev-dhcp': - interface_carpdev_dhcp_configure($interface); - break; case 'dhcp': interface_dhcp_configure($interface); break; @@ -2983,20 +2886,6 @@ function interface_configure($interface = "wan", $reloadall = false, $linkupeven return 0; } -function interface_carpdev_dhcp_configure($interface = "wan") { - global $config, $g; - - $wancfg = $config['interfaces'][$interface]; - $wanif = $wancfg['if']; - /* bring wan interface up before starting dhclient */ - if($wanif) - interfaces_bring_up($wanif); - else - log_error(gettext("Could not bring wanif up in interface_carpdev_dhcp_configure()")); - - return 0; -} - function interface_track6_configure($interface = "lan") { global $config, $g; $iflist = get_configured_interface_with_descr(false, true); @@ -3608,7 +3497,7 @@ function convert_real_interface_to_friendly_interface_name($interface = "wan") { if (stristr($interface, "_vip")) { foreach ($config['virtualip']['vip'] as $counter => $vip) { - if ($vip['mode'] == "carpdev-dhcp" || $vip['mode'] == "carp") { + if ($vip['mode'] == "carp") { if ($interface == "{$vip['interface']}_vip{$vip['vhid']}") return $vip['interface']; } @@ -3668,7 +3557,7 @@ function convert_friendly_interface_to_friendly_descr($interface) { } else if (stristr($interface, "_vip")) { if (is_array($config['virtualip']['vip'])) { foreach ($config['virtualip']['vip'] as $counter => $vip) { - if ($vip['mode'] == "carpdev-dhcp" || $vip['mode'] == "carp") { + if ($vip['mode'] == "carp") { if ($interface == "{$vip['interface']}_vip{$vip['vhid']}") return "{$vip['subnet']} - {$vip['descr']}"; } @@ -3840,18 +3729,6 @@ function get_real_interface($interface = "wan") { */ switch ($cfg['ipaddr']) { - case "carpdev-dhcp": - $viparr = &$config['virtualip']['vip']; - if(is_array($viparr)) - foreach ($viparr as $counter => $vip) { - if ($vip['mode'] == "carpdev-dhcp") { - if($vip['interface'] == $interface) { - $wanif = "carp{$counter}"; - break; - } - } - } - break; case "pppoe": case "pptp": case "l2tp": @@ -3977,7 +3854,7 @@ function find_carp_interface($ip) { global $config; if (is_array($config['virtualip']['vip'])) { foreach ($config['virtualip']['vip'] as $vip) { - if ($vip['mode'] == "carp" || $vip['mode'] == "carpdev") { + if ($vip['mode'] == "carp") { if(is_ipaddrv4($ip)) { $carp_ip = get_interface_ip($vip['interface']); } @@ -4044,7 +3921,7 @@ function link_ip_to_carp_interface($ip) { $first = 0; $carp_int = array(); foreach ($config['virtualip']['vip'] as $vip) { - if ($vip['mode'] == "carp" || $vip['mode'] == "carpdev") { + if ($vip['mode'] == "carp") { $carp_ip = $vip['subnet']; $carp_sn = $vip['subnet_bits']; $carp_nw = gen_subnet($carp_ip, $carp_sn); @@ -4436,7 +4313,6 @@ function get_interfaces_with_gateway() { foreach($config['interfaces'] as $ifdescr => $ifname) { switch ($ifname['ipaddr']) { case "dhcp": - case "carpdev-dhcp": case "ppp"; case "pppoe": case "pptp": @@ -4462,7 +4338,6 @@ function interface_has_gateway($friendly) { $ifname = &$config['interfaces'][$friendly]; switch ($ifname['ipaddr']) { case "dhcp": - case "carpdev-dhcp": case "pppoe": case "pptp": case "l2tp": diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 103c237..9402eb7 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -1217,7 +1217,6 @@ function get_interface_info($ifdescr) { switch ($link_type) { /* DHCP? -> see if dhclient is up */ case "dhcp": - case "carpdev-dhcp": /* see if dhclient is up */ if (find_dhclient_process($ifinfo['if']) <> "") $ifinfo['dhcplink'] = "up"; diff --git a/etc/inc/util.inc b/etc/inc/util.inc index 3669996..6146d7c 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -655,7 +655,6 @@ function get_configured_carp_interface_list() { foreach ($viparr as $vip) { switch ($vip['mode']) { case "carp": - case "carpdev-dhcp": $vipif = "{$vip['interface']}_vip{$vip['vhid']}"; $iflist[$vipif] = $vip['subnet']; break; diff --git a/etc/rc.banner b/etc/rc.banner index 0147ef4..8694011 100755 --- a/etc/rc.banner +++ b/etc/rc.banner @@ -54,9 +54,6 @@ $ifconf = $config['interfaces'][$ifname]; /* look for 'special cases' */ switch($ifconf['ipaddr']) { - case "carpdev-dhcp": - $class = "(CarpDEV)"; - break; case "dhcp": $class = "(DHCP)"; break; diff --git a/usr/local/www/carp_status.php b/usr/local/www/carp_status.php index f8fb7c3..bebdf94 100755 --- a/usr/local/www/carp_status.php +++ b/usr/local/www/carp_status.php @@ -61,10 +61,6 @@ if($_POST['disablecarp'] <> "") { interface_vip_bring_down($vip); sleep(1); break; - case "carpdev-dhcp": - interface_vip_bring_down($vip); - sleep(1); - break; } } } @@ -79,10 +75,6 @@ if($_POST['disablecarp'] <> "") { interface_carp_configure($vip); sleep(1); break; - case "carpdev-dhcp": - interface_carpdev_configure($vip); - sleep(1); - break; case "ipalias": if (strstr($vip['interface'], "_vip")) interface_ipalias_configure($vip); diff --git a/usr/local/www/firewall_virtual_ip.php b/usr/local/www/firewall_virtual_ip.php index 87c32f6..36e48ab 100755 --- a/usr/local/www/firewall_virtual_ip.php +++ b/usr/local/www/firewall_virtual_ip.php @@ -78,9 +78,6 @@ if ($_POST) { case "carp": interface_carp_configure($a_vip[$vid]); break; - case "carpdev-dhcp": - interface_carpdev_configure($a_vip[$vid]); - break; default: break; } @@ -196,7 +193,7 @@ include("head.inc"); "" or $vipent['range'] <> "" or - $vipent['subnet_bits'] <> "" or (isset($vipent['range']['from']) && $vipent['range']['from'] <> "") or $vipent['mode'] == "carpdev-dhcp"): ?> + $vipent['subnet_bits'] <> "" or (isset($vipent['range']['from']) && $vipent['range']['from'] <> "")): ?> - - + - "; elseif($vipent['mode'] == "carp" or $vipent['mode'] == "carpdev-dhcp") echo ""; elseif($vipent['mode'] == "other") echo ""; elseif($vipent['mode'] == "ipalias") echo "";?> + "; elseif($vipent['mode'] == "carp") echo ""; elseif($vipent['mode'] == "other") echo ""; elseif($vipent['mode'] == "ipalias") echo "";?>   diff --git a/usr/local/www/firewall_virtual_ip_edit.php b/usr/local/www/firewall_virtual_ip_edit.php index c0a21dc..f91fa79 100755 --- a/usr/local/www/firewall_virtual_ip_edit.php +++ b/usr/local/www/firewall_virtual_ip_edit.php @@ -145,7 +145,6 @@ if ($_POST) { */ switch ($_POST['mode']) { case "carp": - case "carpdev-dhcp": /* verify against reusage of vhids */ $idtracker = 0; foreach($config['virtualip']['vip'] as $vip) { @@ -210,7 +209,7 @@ if ($_POST) { } /* CARP specific fields */ - if ($_POST['mode'] === "carp" or $_POST['mode'] == "carpdev-dhcp") { + if ($_POST['mode'] === "carp") { $vipent['vhid'] = $_POST['vhid']; $vipent['advskew'] = $_POST['advskew']; $vipent['advbase'] = $_POST['advbase']; @@ -233,12 +232,6 @@ if ($_POST) { $vipent['subnet'] = $_POST['subnet']; } - if ($_POST['mode'] == "carpdev-dhcp") { - unset($vipent['subnet']); - unset($vipent['subnet_bits']); - unset($vipent['alias-subnet']); - } - if (!isset($id)) $id = count($a_vip); if (file_exists("{$g['tmp_path']}/.firewall_virtual_ip.apply")) @@ -339,21 +332,6 @@ function enable_change(enable_over) { document.iform.noexpand.disabled = 1; jQuery('#noexpandrow').css('display','none'); } - if (get_radio_value(document.iform.mode) == "carpdev-dhcp") { - document.iform.type.disabled = 1; - note.removeChild(note.firstChild); - note.appendChild(ipaliasnote); - document.iform.subnet_bits.disabled = 1; - document.iform.subnet.disabled = 1; - document.iform.subnet.value = ''; - document.iform.subnet_bits.value = ''; - document.iform.vhid.disabled = 0; - document.iform.password.disabled = 0; - document.iform.advskew.disabled = 0; - document.iform.advbase.disabled = 0; - document.iform.noexpand.disabled = 1; - jQuery('#noexpandrow').css('display','none'); - } typesel_change(); } function typesel_change() { @@ -410,13 +388,6 @@ function typesel_change() { > > -> CarpDEV-DHCP -*/ -?> - diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index 208e088..0f99466 100755 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -192,9 +192,6 @@ switch($wancfg['ipaddr']) { case "dhcp": $pconfig['type'] = "dhcp"; break; - case "carpdev-dhcp": - $pconfig['ipaddr'] = ""; - break; case "pppoe": case "pptp": case "l2tp": @@ -739,15 +736,6 @@ if ($_POST['apply']) { $a_gateways[] = $gateway_item; } break; - case "carpdev-dhcp": - $wancfg['ipaddr'] = "carpdev-dhcp"; - $wancfg['dhcphostname'] = $_POST['dhcphostname']; - $wancfg['alias-address'] = $_POST['alias-address']; - $wancfg['alias-subnet'] = $_POST['alias-subnet']; - if($gateway_item) { - $a_gateways[] = $gateway_item; - } - break; case "ppp": $a_ppps[$pppid]['ptpid'] = $_POST['ptpid']; $a_ppps[$pppid]['type'] = $_POST['type']; @@ -1115,7 +1103,7 @@ $statusurl = "status_interfaces.php"; $closehead = false; include("head.inc"); -$types4 = array("none" => gettext("None"), "staticv4" => gettext("Static IPv4"), "dhcp" => gettext("DHCP"), "ppp" => gettext("PPP"), "pppoe" => gettext("PPPoE"), "pptp" => gettext("PPTP"), "l2tp" => gettext("L2TP") /* , "carpdev-dhcp" => "CarpDev"*/); +$types4 = array("none" => gettext("None"), "staticv4" => gettext("Static IPv4"), "dhcp" => gettext("DHCP"), "ppp" => gettext("PPP"), "pppoe" => gettext("PPPoE"), "pptp" => gettext("PPTP"), "l2tp" => gettext("L2TP")); $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"), "dhcp6" => gettext("DHCP6"), "slaac" => gettext("SLAAC"), "6rd" => gettext("6rd Tunnel"), "6to4" => gettext("6to4 Tunnel"), "track6" => gettext("Track Interface")); ?> diff --git a/usr/local/www/xmlrpc.php b/usr/local/www/xmlrpc.php index 88138ea..d657f03 100755 --- a/usr/local/www/xmlrpc.php +++ b/usr/local/www/xmlrpc.php @@ -249,9 +249,6 @@ function restore_config_section_xmlrpc($raw_params) { $carp_setuped = true; interface_carp_configure($vip); break; - case "carpdev-dhcp": - interface_carpdev_configure($vip); - break; } } /* Cleanup remaining old carps */ -- cgit v1.1