mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Use system_get_arp_table()
This commit is contained in:
parent
5a41b18c56
commit
cda4e23edf
@ -172,8 +172,13 @@ if ($_POST['save']) {
|
||||
|
||||
// Get the MAC address
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
$mymac = `/usr/sbin/arp -an | grep '('{$ip}')' | head -n 1 | cut -d" " -f4`;
|
||||
$mymac = str_replace("\n", "", $mymac);
|
||||
$arp_table = system_get_arp_table();
|
||||
if (($key = array_search($ip, array_column($arp_table, 'ip-address')))
|
||||
!== FALSE) {
|
||||
if (!empty($arp_table[$key]['mac-address'])) {
|
||||
$mymac = $arp_table[$key]['mac-address'];
|
||||
}
|
||||
}
|
||||
|
||||
include("head.inc");
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user