1
mirror of https://github.com/rapid7/metasploit-payloads synced 2025-01-02 11:36:22 +01:00

Use the first entry returned by getaddrinfo

Fixes #479
This commit is contained in:
Spencer McIntyre 2021-03-29 17:31:28 -04:00
parent 6e08d1f981
commit 57c6f10314

View File

@ -953,7 +953,7 @@ def netlink_request(req_type, req_data):
def resolve_host(hostname, family): def resolve_host(hostname, family):
address_info = getaddrinfo(hostname, family=family, socktype=socket.SOCK_DGRAM, proto=socket.IPPROTO_UDP) address_info = getaddrinfo(hostname, family=family, socktype=socket.SOCK_DGRAM, proto=socket.IPPROTO_UDP)
address = address_info['sockaddr'][0] address = address_info[0]['sockaddr'][0]
return {'family': family, 'address': address, 'packed_address': inet_pton(family, address)} return {'family': family, 'address': address, 'packed_address': inet_pton(family, address)}
def tlv_pack_local_addrinfo(sock): def tlv_pack_local_addrinfo(sock):