summaryrefslogtreecommitdiff
path: root/AISCommon.c
diff options
context:
space:
mode:
authorJohn Wiseman <john.wiseman@cantab.net>2023-01-25 10:12:51 +0000
committerJohn Wiseman <john.wiseman@cantab.net>2023-01-25 10:12:51 +0000
commitc15de2c7f7e70c97a89b591b3ece72c5047ab4fa (patch)
tree576b57d456bea59c60d265149e7969769bb6b015 /AISCommon.c
parent9a44d00480888cb11c614034489cc048d798f40f (diff)
6.0.23.4223.46
Diffstat (limited to 'AISCommon.c')
-rw-r--r--AISCommon.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/AISCommon.c b/AISCommon.c
index 300e888..a193d2f 100644
--- a/AISCommon.c
+++ b/AISCommon.c
@@ -3201,6 +3201,19 @@ static VOID ADSBConnect(void * unused)
destaddr.sin_family = AF_INET;
destaddr.sin_port = htons(ADSBPort);
+ if (destaddr.sin_addr.s_addr == INADDR_NONE)
+ {
+ // Resolve name to address
+
+ struct hostent * HostEnt = gethostbyname(ADSBHost);
+
+ if (!HostEnt)
+ return; // Resolve failed
+
+ memcpy(&destaddr.sin_addr.s_addr,HostEnt->h_addr,4);
+ }
+
+
TCPSock = socket(AF_INET,SOCK_STREAM,0);
if (TCPSock == INVALID_SOCKET)