mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 12:41:29 +00:00
Set ss_family when generating random decoys. Fixes #2757.
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
#Nmap Changelog ($Id$); -*-text-*-
|
||||
|
||||
o [GH#2757] Fix a crash in traceroute when using randomly-generated decoys:
|
||||
"Assertion `source->ss_family == AF_INET' failed" [Daniel Miller]
|
||||
|
||||
o [GH#2899] When IP protocol scanning on IPv6 (-sO -6), skip protocol numbers
|
||||
that are registered as Extension Header values. When the --data option was
|
||||
used, these would fail the assertion "len == (u32) ntohs(ip6->ip6_plen)"
|
||||
|
||||
7
nmap.cc
7
nmap.cc
@@ -1780,9 +1780,12 @@ void apply_delayed_options() {
|
||||
fatal("You are only allowed %d decoys (if you need more redefine MAX_DECOYS in nmap.h)", MAX_DECOYS);
|
||||
|
||||
while (i--) {
|
||||
sockaddr_storage *ss = &o.decoys[o.numdecoys];
|
||||
memset(ss, 0, sizeof(sockaddr_storage));
|
||||
ss->ss_family = AF_INET;
|
||||
do {
|
||||
((struct sockaddr_in *)&o.decoys[o.numdecoys])->sin_addr.s_addr = get_random_u32();
|
||||
} while (ip_is_reserved(&o.decoys[o.numdecoys]));
|
||||
((struct sockaddr_in *)ss)->sin_addr.s_addr = get_random_u32();
|
||||
} while (ip_is_reserved(ss));
|
||||
o.numdecoys++;
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user