Skip to content

Commit

Permalink
Fix typo for wrong variable
Browse files Browse the repository at this point in the history
Grennith committed Nov 29, 2023
1 parent 7b47dd0 commit db77488
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mapadroid/websocket/communicator.py
Original file line number Diff line number Diff line change
@@ -280,7 +280,7 @@ async def get_external_ip(self) -> Optional[str]:
# https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses
ipv6_search = re.search('(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))', res)
if ipv6_search:
ip_address_found = found.group(1)
ip_address_found = ipv6_search.group(1)
except Exception as e:
logger.error(f"Failed parsing external IP: {e}")
return None

0 comments on commit db77488

Please sign in to comment.