1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-15 20:29:03 +00:00

Added ND ping for local IPv6 nets, merging from /nmap-exp/weilin/nmap-nd.

This commit is contained in:
weilin
2011-07-19 02:31:54 +00:00
parent 737035118a
commit 1dcf652410
16 changed files with 707 additions and 33 deletions

View File

@@ -306,6 +306,14 @@ const struct in_addr *Target::v4sourceip() const {
return NULL;
}
// Returns IPv6 host address or NULL if unavailable.
const struct in6_addr *Target::v6sourceip() const {
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) &sourcesock;
if (sin6->sin6_family == AF_INET6) {
return &(sin6->sin6_addr);
}
return NULL;
}
/* You can set to NULL to erase a name or if it failed to resolve -- or
just don't call this if it fails to resolve */