mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Use less memory for ip_addr in port_reason.
This was a sockaddr_storage, which is 128 bytes. This is a lot for a structure that is part of Port. It is now a union of sockaddr_in and sockaddr_in6, which is 28 bytes. A new set_ip_addr method sets the union from a sockaddr_storage, where plain assignment was used before. The sockaddr_storage was introduced in r23778, the first big IPv6 merge.
This commit is contained in:
@@ -5381,7 +5381,7 @@ static int get_ping_pcap_result(UltraScanInfo *USI, struct timeval *stime) {
|
||||
hss->target->reason.reason_id = current_reason;
|
||||
hss->target->reason.ttl = hdr.ttl;
|
||||
if (sockaddr_storage_cmp(&hdr.src, &target_dst) != 0) {
|
||||
hss->target->reason.ip_addr = hdr.src;
|
||||
hss->target->reason.set_ip_addr(&hdr.src);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user