Skip to content

Commit

Permalink
Merge pull request #54 from genofire/patch-3
Browse files Browse the repository at this point in the history
[BUGFIX] use MAC address from batctl
  • Loading branch information
TobleMiner authored Apr 8, 2020
2 parents d7f6175 + b57ca41 commit 5395852
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions providers/neighbours/batadv.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ def required_args(self):
return ['batadv_dev']

def call(self, batadv_dev):
lines = call(['batctl', '-m', batadv_dev, 'o'])
lines = call(['batctl', '-m', batadv_dev, 'o', '-nH'])
neighbours = {}
prefix_lower = '/sys/class/net/{}/lower_'.format(batadv_dev)
for dev in glob(prefix_lower + '*'):
ifname = dev[len(prefix_lower):]
mac = open(dev + '/address').read().strip()
ifneighbours = {}
for line in lines[2:]:
for line in lines:
for s in ['(', ')', '[', ']:', ']', '*']:
line = line.replace(s, '')
fields = line.split()
Expand Down

0 comments on commit 5395852

Please sign in to comment.