1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31: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:
kris
2010-08-02 07:53:40 +00:00
parent 35dd4e1377
commit 75580c850b

View File

@@ -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);