Skip to content

Commit 9b58e59

Browse files
committed
CRAI finding
1 parent 626ddf3 commit 9b58e59

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

airos/airos8.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ def derived_data(
197197
"""Add derived data to the device response."""
198198
addresses = {}
199199
interface_order = ["br0", "eth0", "ath0"]
200+
200201
interfaces = response.get("interfaces", [])
201202

202203
# No interfaces, no mac, no usability
@@ -208,11 +209,12 @@ def derived_data(
208209
addresses[interface["ifname"]] = interface["hwaddr"]
209210

210211
for interface in interface_order:
211-
response["derived"] = {
212-
"mac": addresses[interface],
213-
"mac_interface": interface,
214-
}
215-
return response
212+
if interface in interfaces:
213+
response["derived"] = {
214+
"mac": addresses[interface],
215+
"mac_interface": interface,
216+
}
217+
return response
216218

217219
# Fallback take fist alternate interface found
218220
response["derived"] = {

0 commit comments

Comments
 (0)