Re: no reassembly for outgoing packets on RAW socket

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jiri Olsa
Date: Monday, June 7, 2010 - 7:55 am

On Fri, Jun 04, 2010 at 02:03:17PM +0200, Patrick McHardy wrote:

ok,

I tried the NOTRACK target, but the packet is still going
throught reassembly, because the RAW filter has lower priority
then the connection track defragmentation..

I was able to get it bypassed by attached patch and following
command:

	iptables -v -t raw -A OUTPUT -p icmp -j NOTRACK

again, not sure if this is too invasive ;)

If this is not the way, I'd appreciatte any hint..  my goal is
to put malformed packet on the wire (more frags bit set for a
non fragmented packet)


thanks for help,
jirka

---
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h
index 29c7727..d249b6a 100644
--- a/include/linux/netfilter_ipv4.h
+++ b/include/linux/netfilter_ipv4.h
@@ -53,8 +53,8 @@
 
 enum nf_ip_hook_priorities {
 	NF_IP_PRI_FIRST = INT_MIN,
-	NF_IP_PRI_CONNTRACK_DEFRAG = -400,
-	NF_IP_PRI_RAW = -300,
+	NF_IP_PRI_RAW = -400,
+	NF_IP_PRI_CONNTRACK_DEFRAG = -300,
 	NF_IP_PRI_SELINUX_FIRST = -225,
 	NF_IP_PRI_CONNTRACK = -200,
 	NF_IP_PRI_MANGLE = -150,
diff --git a/net/ipv4/netfilter/nf_defrag_ipv4.c b/net/ipv4/netfilter/nf_defrag_ipv4.c
index cb763ae..cb865d1 100644
--- a/net/ipv4/netfilter/nf_defrag_ipv4.c
+++ b/net/ipv4/netfilter/nf_defrag_ipv4.c
@@ -74,6 +74,9 @@ static unsigned int ipv4_conntrack_defrag(unsigned int hooknum,
 		return NF_ACCEPT;
 #endif
 #endif
+	if (nf_ct_is_untracked(skb))
+		return NF_ACCEPT;
+
 	/* Gather fragments. */
 	if (ip_hdr(skb)->frag_off & htons(IP_MF | IP_OFFSET)) {
 		enum ip_defrag_users user = nf_ct_defrag_user(hooknum, skb);
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
no reassembly for outgoing packets on RAW socket, Jiri Olsa, (Fri Jun 4, 4:27 am)
Re: no reassembly for outgoing packets on RAW socket, Patrick McHardy, (Fri Jun 4, 5:03 am)
Re: no reassembly for outgoing packets on RAW socket, Jiri Olsa, (Mon Jun 7, 7:55 am)
Re: no reassembly for outgoing packets on RAW socket, Patrick McHardy, (Wed Jun 9, 7:16 am)
Re: no reassembly for outgoing packets on RAW socket, Jan Engelhardt, (Wed Jun 9, 8:15 am)
Re: no reassembly for outgoing packets on RAW socket, Patrick McHardy, (Wed Jun 9, 8:16 am)
Re: no reassembly for outgoing packets on RAW socket, Jan Engelhardt, (Wed Jun 9, 8:20 am)
Re: no reassembly for outgoing packets on RAW socket, Patrick McHardy, (Thu Jun 10, 2:14 am)
Re: no reassembly for outgoing packets on RAW socket, Patrick McHardy, (Thu Jun 10, 3:04 am)
Re: no reassembly for outgoing packets on RAW socket, Jan Engelhardt, (Fri Jun 11, 2:53 am)
[PATCH] net: IP_NODEFRAG option for IPv4 socket, Jiri Olsa, (Mon Jun 14, 11:53 pm)
Re: [PATCH] net: IP_NODEFRAG option for IPv4 socket, Eric Dumazet, (Tue Jun 15, 12:13 am)
Re: [PATCH] net: IP_NODEFRAG option for IPv4 socket, Jiri Olsa, (Tue Jun 15, 2:18 am)
Re: [PATCH] net: IP_NODEFRAG option for IPv4 socket, Eric Dumazet, (Tue Jun 15, 2:49 am)