Merge pull request #227 from aafbsd/patch-1

fix getnameinfo
pull/217/head
David Schweikert 3 years ago committed by GitHub
commit 749127f525
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2102,7 +2102,7 @@ int decode_icmp_ipv4(
/* too short */ /* too short */
if (verbose_flag) { if (verbose_flag) {
char buf[INET6_ADDRSTRLEN]; char buf[INET6_ADDRSTRLEN];
getnameinfo((struct sockaddr*)&response_addr, sizeof(response_addr), buf, INET6_ADDRSTRLEN, NULL, 0, NI_NUMERICHOST); getnameinfo( response_addr, sizeof( struct sockaddr_in ), buf, INET6_ADDRSTRLEN, NULL, 0, NI_NUMERICHOST);
printf("received packet too short for ICMP (%d bytes from %s)\n", (int)reply_buf_len, buf); printf("received packet too short for ICMP (%d bytes from %s)\n", (int)reply_buf_len, buf);
} }
return -1; return -1;
@ -2135,7 +2135,7 @@ int decode_icmp_ipv4(
return -1; return -1;
} }
getnameinfo(response_addr, response_addr_len, addr_ascii, INET6_ADDRSTRLEN, NULL, 0, NI_NUMERICHOST); getnameinfo(response_addr, sizeof( struct sockaddr_in ), addr_ascii, INET6_ADDRSTRLEN, NULL, 0, NI_NUMERICHOST);
switch (icp->icmp_type) { switch (icp->icmp_type) {
case ICMP_UNREACH: case ICMP_UNREACH:

Loading…
Cancel
Save