Make preference for IPv6 when IP: :: more explicit for OBP

This commit is contained in:
Simon 2021-07-06 01:12:19 +01:00
parent 423bb3e5cd
commit 497fa3143a
3 changed files with 6 additions and 2 deletions

View File

@ -333,7 +333,10 @@ def build_config(_config_file):
try:
if CONFIG['SYSTEMS'][section]['IP'] == '::':
addr_info = socket.getaddrinfo(CONFIG['SYSTEMS'][section]['TARGET_IP'],CONFIG['SYSTEMS'][section]['TARGET_PORT'],socket.AF_UNSPEC, socket.IPPROTO_IP)
try:
addr_info = socket.getaddrinfo(CONFIG['SYSTEMS'][section]['TARGET_IP'],CONFIG['SYSTEMS'][section]['TARGET_PORT'],socket.AF_INET6, socket.IPPROTO_IP)
except gaierror:
addr_info = socket.getaddrinfo(CONFIG['SYSTEMS'][section]['TARGET_IP'],CONFIG['SYSTEMS'][section]['TARGET_PORT'],socket.AF_INET, socket.IPPROTO_IP)
elif CONFIG['SYSTEMS'][section]['IP'] and IsIPv6Address(CONFIG['SYSTEMS'][section]['IP']):
addr_info = socket.getaddrinfo(CONFIG['SYSTEMS'][section]['TARGET_IP'],CONFIG['SYSTEMS'][section]['TARGET_PORT'],socket.AF_INET6, socket.IPPROTO_IP)

View File

@ -1,4 +1,4 @@
FROM python:3.7-alpine
aplFROM python:3.7-alpine
COPY entrypoint-proxy /entrypoint

View File

@ -11,3 +11,4 @@ services:
- '62045-62049:62045-62049/udp'
- '4321:4321/tcp'
image: 'hacknix/freedmr:latest'
restart: "unless-stopped"