summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/services_dhcp_edit.php
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2017-02-10 15:57:42 -0200
committerRenato Botelho <renato@netgate.com>2017-02-10 15:57:42 -0200
commit726de9feb31170f11f4b505103ddbf9b91722169 (patch)
tree0e9aadc5227ec264b24796e252fa36185d50f425 /src/usr/local/www/services_dhcp_edit.php
parentdde7eda228b29bde2053c3390ef9efc6d790b80a (diff)
parent20cf8d8e20fa28c16e86ce0d91e57e4d78427d26 (diff)
downloadpfsense-726de9feb31170f11f4b505103ddbf9b91722169.zip
pfsense-726de9feb31170f11f4b505103ddbf9b91722169.tar.gz
Merge pull request #3492 from luckman212/dhcp-edit-patch-2
Diffstat (limited to 'src/usr/local/www/services_dhcp_edit.php')
-rw-r--r--src/usr/local/www/services_dhcp_edit.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/usr/local/www/services_dhcp_edit.php b/src/usr/local/www/services_dhcp_edit.php
index 269acf4..3d702fd 100644
--- a/src/usr/local/www/services_dhcp_edit.php
+++ b/src/usr/local/www/services_dhcp_edit.php
@@ -385,8 +385,7 @@ if ($_POST) {
// Get our MAC address
$ip = $_SERVER['REMOTE_ADDR'];
-$mymac = `/usr/sbin/arp -an | grep '('{$ip}')' | cut -d" " -f4`;
-$mymac = str_replace("\n", "", $mymac);
+$mymac = arp_get_mac_by_ip($ip, false);
$iflist = get_configured_interface_with_descr();
$ifname = '';
@@ -427,7 +426,9 @@ $btnmymac->setAttribute('type','button')->removeClass('btn-primary')->addClass('
$group = new Form_Group('MAC Address');
$group->add($macaddress);
-$group->add($btnmymac);
+if (!empty($mymac)) {
+ $group->add($btnmymac);
+}
$group->setHelp('MAC address (6 hex octets separated by colons)');
$section->add($group);
OpenPOWER on IntegriCloud