From 632e5f504fed668c328eea3c0af702d1b4998289 Mon Sep 17 00:00:00 2001 From: jim-p Date: Wed, 28 Sep 2016 11:12:42 -0400 Subject: Apply static ARP entries more consistently when adding and removing static mapping entries. Fixes #6821 --- src/usr/local/www/services_dhcp.php | 4 ++++ src/usr/local/www/services_dhcp_edit.php | 7 +++++++ 2 files changed, 11 insertions(+) (limited to 'src/usr/local/www') diff --git a/src/usr/local/www/services_dhcp.php b/src/usr/local/www/services_dhcp.php index 5c90fe3..2419b00 100644 --- a/src/usr/local/www/services_dhcp.php +++ b/src/usr/local/www/services_dhcp.php @@ -632,6 +632,10 @@ if ($act == "delpool") { if ($act == "del") { if ($a_maps[$_GET['id']]) { + /* Remove staic ARP entry, if necessary */ + if (isset($a_maps[$_GET['id']]['arp_table_static_entry'])) { + mwexec("/usr/sbin/arp -d " . escapeshellarg($a_maps[$_GET['id']]['ipaddr'])); + } unset($a_maps[$_GET['id']]); write_config(); if (isset($config['dhcpd'][$if]['enable'])) { diff --git a/src/usr/local/www/services_dhcp_edit.php b/src/usr/local/www/services_dhcp_edit.php index f599610..0d9ab28 100644 --- a/src/usr/local/www/services_dhcp_edit.php +++ b/src/usr/local/www/services_dhcp_edit.php @@ -362,6 +362,13 @@ if ($_POST) { } } + /* Configure staic ARP entry, or remove ARP entry if this host is dynamic. See https://redmine.pfsense.org/issues/6821 */ + if ($mapent['arp_table_static_entry']) { + mwexec("/usr/sbin/arp -S " . escapeshellarg($mapent['ipaddr']) . " " . escapeshellarg($mapent['mac'])); + } else { + mwexec("/usr/sbin/arp -d " . escapeshellarg($mapent['ipaddr'])); + } + header("Location: services_dhcp.php?if={$if}"); exit; } -- cgit v1.1