Skip to content

Commit

Permalink
Merge pull request #20 from khng300/master
Browse files Browse the repository at this point in the history
Set sa_len properly in getdefaultgateway()
  • Loading branch information
miniupnp authored Jan 22, 2022
2 parents d922a12 + 39ad4b3 commit 724dc69
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions getgateway.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,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);
Expand Down

0 comments on commit 724dc69

Please sign in to comment.