Skip to contentSkip to conversation

Netfilter callbacks and UDP fragmenting

DISCUSSION Tomas Mandys 2 participants 2 messages Oct 1, 2007 netfilter

lore
Share & tools
lore
#0 lore raw

Hi,
are UDP packets defragmented before are passed to netfilter callback functions (e.g. PREROUTING) or developer has to create buffer and defragment by himself, to release memory when a fragment is missing, etc. - is there a working implementation/example? How about locally generated packets in OUTPUT callback?

I've looked e.g. in nf_conntrack_sip.c and I can't see any extra defragmentation code even SIP message can be fragmented, especially SDP content.

Thanks
Tomas

#1 lore raw

Hi,

Quoted 9 lines · Tomas Mandys

are UDP packets defragmented before are passed to netfilter callback functions (e.g. PREROUTING) or developer has to create buffer and defragment by himself, to release memory when a fragment is missing, etc. - is there a working implementation/example? How about locally generated packets in OUTPUT callback?

I've looked e.g. in nf_conntrack_sip.c and I can't see any extra defragmentation code even SIP message can be fragmented, especially SDP content.

Netfilter IPv4 connection tracking code defragments all IPv4 datagrams before processing them. So if you have connection tracking loaded you won't see fragments in your hook functions. If there's a chance that your code will be used without connection tracking then you'll have to handle fragments by yourself.

Signature · 1 line
KOVACS Krisztian