mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 12:41:29 +00:00
Don't fragment IP packets with DF set, even if o.fragscan is set. If a
packet is built to explicitly avoid fragmentation, honor it.
This commit is contained in:
3
tcpip.cc
3
tcpip.cc
@@ -571,7 +571,8 @@ int send_ip_packet(int sd, struct eth_nfo *eth, u8 *packet,
|
||||
assert((int) packetlen > 0);
|
||||
|
||||
/* Fragmentation requested && packet is bigger than MTU */
|
||||
if(o.fragscan && (packetlen - ip->ip_hl * 4 > (unsigned int) o.fragscan)){
|
||||
if(o.fragscan && !(ntohs(ip->ip_off) & IP_DF) &&
|
||||
(packetlen - ip->ip_hl * 4 > (unsigned int) o.fragscan)){
|
||||
res = send_frag_ip_packet(sd, eth, packet, packetlen, o.fragscan);
|
||||
}else{
|
||||
res = send_ip_packet_eth_or_sd(sd, eth, packet, packetlen);
|
||||
|
||||
Reference in New Issue
Block a user