Skip to content

Commit

Permalink
Merge pull request ckdo#2 from LewdNeko/set_interface_ip
Browse files Browse the repository at this point in the history
Fix KeyError for devices which don't support IPv6
  • Loading branch information
systemcrash authored Jul 9, 2021
2 parents bbe5025 + 8bdd659 commit ea4cc17
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ap2-receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,11 +736,11 @@ def upgrade_to_encrypted(self, client_address, shared_key):
DEVICE_ID = None
IPV4 = None
IPV6 = None
if ifen[ni.AF_LINK]:
if ifen.get(ni.AF_LINK):
DEVICE_ID = ifen[ni.AF_LINK][0]["addr"]
if ifen[ni.AF_INET]:
if ifen.get(ni.AF_INET):
IPV4 = ifen[ni.AF_INET][0]["addr"]
if ifen[ni.AF_INET6]:
if ifen.get(ni.AF_INET6):
IPV6 = ifen[ni.AF_INET6][0]["addr"].split("%")[0]

setup_global_structs(args)
Expand Down

0 comments on commit ea4cc17

Please sign in to comment.