Merge pull request #1539 from khng300/getdefaultgateway-rtm-fix

ext/libnatpmp: Set sa_len properly in getdefaultgateway()
This commit is contained in:
Adam Ierymenko 2022-01-20 08:21:24 -05:00 committed by GitHub
commit cb31b3987f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -271,7 +271,9 @@ int getdefaultgateway(in_addr_t *addr)
rtm.rtm_addrs = rtm_addrs;
so_dst.sa_family = AF_INET;
so_dst.sa_len = sizeof(struct sockaddr);
so_mask.sa_family = AF_INET;
so_mask.sa_len = sizeof(struct sockaddr);
NEXTADDR(RTA_DST, so_dst);
NEXTADDR(RTA_NETMASK, so_mask);