1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-15 12:19:02 +00:00

Use casts to fix build error C2664 with Windows SDK 8.1

This commit is contained in:
dmiller
2021-07-26 18:43:17 +00:00
parent 322dfed68a
commit f22816da84

View File

@@ -232,7 +232,7 @@ void PacketTrace::traceND(pdirection pdir, const u8 *frame, u32 len,
if (msg_len < 20) { if (msg_len < 20) {
Snprintf(desc, sizeof(desc), "packet too short"); Snprintf(desc, sizeof(desc), "packet too short");
} else { } else {
inet_ntop(AF_INET6, &msg->nd.icmpv6_target, who_has, sizeof(who_has)); inet_ntop(AF_INET6, (void *)&msg->nd.icmpv6_target, who_has, sizeof(who_has));
Snprintf(desc, sizeof(desc), "who has %s", who_has); Snprintf(desc, sizeof(desc), "who has %s", who_has);
} }
} else if (icmpv6->icmpv6_type == ICMPV6_NEIGHBOR_ADVERTISEMENT) { } else if (icmpv6->icmpv6_type == ICMPV6_NEIGHBOR_ADVERTISEMENT) {
@@ -243,7 +243,7 @@ void PacketTrace::traceND(pdirection pdir, const u8 *frame, u32 len,
/* We only handle target link-layer address in the first option. */ /* We only handle target link-layer address in the first option. */
Snprintf(desc, sizeof(desc), "no link-layer address"); Snprintf(desc, sizeof(desc), "no link-layer address");
} else { } else {
inet_ntop(AF_INET6, &msg->nd.icmpv6_target, tgt_is, sizeof(tgt_is)); inet_ntop(AF_INET6, (void *)&msg->nd.icmpv6_target, tgt_is, sizeof(tgt_is));
Snprintf(desc, sizeof(desc), "%s is at %s", Snprintf(desc, sizeof(desc), "%s is at %s",
tgt_is, eth_ntoa(&msg->nd.icmpv6_mac)); tgt_is, eth_ntoa(&msg->nd.icmpv6_mac));
} }
@@ -252,8 +252,8 @@ void PacketTrace::traceND(pdirection pdir, const u8 *frame, u32 len,
return; return;
} }
inet_ntop(AF_INET6, &ip6->ip6_src, src, sizeof(src)); inet_ntop(AF_INET6, (void *)&ip6->ip6_src, src, sizeof(src));
inet_ntop(AF_INET6, &ip6->ip6_dst, dst, sizeof(dst)); inet_ntop(AF_INET6, (void *)&ip6->ip6_dst, dst, sizeof(dst));
log_write(LOG_STDOUT | LOG_NORMAL, "%s (%.4fs) %s %s > %s %s\n", log_write(LOG_STDOUT | LOG_NORMAL, "%s (%.4fs) %s %s > %s %s\n",
(pdir == SENT) ? "SENT" : "RCVD", (pdir == SENT) ? "SENT" : "RCVD",
o.TimeSinceStart(&tv), label, src, dst, desc); o.TimeSinceStart(&tv), label, src, dst, desc);