Skip to contentSkip to conversation

Netfilter: Fix for NAT core on nonlinear skbs

PATCH In review Rusty Russell 1 participant 1 message Jan 5, 2005

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

PATCH 16/18 Netfilter: Fix for NAT core on nonlinear skbs

Name: Fix for NAT core on nonlinear skbs
Status: Tested under nfsim

The nat core calls skb_ip_make_writable() with a length too short. Found by nfsim.

net/ipv4/netfilter/ip_nat_core.c +1 -1
Index: linux-2.6.10-bk1-Netfilter/net/ipv4/netfilter/ip_nat_core.c
===================================================================
@@ -466,7 +466,7 @@
 	struct iphdr *iph;
 
 	(*pskb)->nfcache |= NFC_ALTERED;
-	if (!skb_ip_make_writable(pskb, iphdroff+sizeof(iph)))
+	if (!skb_ip_make_writable(pskb, iphdroff+sizeof(*iph)))
 		return 0;
 
 	iph = (void *)(*pskb)->data + iphdroff;