From 75580c850b1b5ea71d0d613c50ad4e39d67be2ce Mon Sep 17 00:00:00 2001 From: kris Date: Mon, 2 Aug 2010 07:53:40 +0000 Subject: [PATCH] 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. --- tcpip.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tcpip.cc b/tcpip.cc index ceba514be..2f56188df 100644 --- a/tcpip.cc +++ b/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);