Skip to contentSkip to conversation

nf_defrag_ipv4: what does net/ipv4/netfilter/nf_defrag_ipv4.c used for?

QUESTION Wei Yongjun 1 participant 1 message Jun 12, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi
Can someome tell me what does net/ipv4/netfilter/nf_defrag_ipv4.c
used for? When I looking the source of nf_defrag_ipv4, I found something strange.

If NF_DEFRAG_IPV4 is not selected when compile kernel, the normal
path of ipv4 fragment process is like this:

                      ____________________
 IPv4 Fragment  ---> |  NF_IP_PRE_ROUTING |--> routing input -> ip_defrag()
                     |____________________|

But is NF_DEFRAG_IPV4=y, the ipv4 fragment process is like this:

                      ____________________
 IPv4 Fragment  ---> |  NF_IP_PRE_ROUTING | -> ip_defrag()
                     |____________________|

The only thing nf_defrag_ipv4 do is not select input route.

This cause problem that if the defragment is timeout, the ICMP fragment timeout can not be sent out, because the input skb has no route information.

void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)

{
      ...
      struct rtable *rt = skb_in->rtable;
      ...
      if (!rt)
          goto out;           <--- fail in this step
      ...
}

Any idea for this?