Skip to content

Commit

Permalink
(list_arp.py) only parse lease sections https://forum.opnsense.org/in…
Browse files Browse the repository at this point in the history
  • Loading branch information
AdSchellevis committed Dec 14, 2016
1 parent 6124cdc commit feb11e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/opnsense/scripts/interfaces/list_arp.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
if os.path.isfile(dhcp_leases_filename):
leases = open(dhcp_leases_filename, 'r').read()
for lease in leases.split('}'):
if lease.find('{') > -1:
if lease.strip().find('lease') == 0 and lease.find('{') > -1:
dhcp_ipv4_address = lease.split('{')[0].split('lease')[1].strip()
if lease.find('client-hostname') > -1:
dhcp_leases[dhcp_ipv4_address] = {'hostname': lease.split('client-hostname')[1].strip()[1:-2]}
Expand Down

0 comments on commit feb11e5

Please sign in to comment.