All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2] netfilter: Remove skb_is_nonlinear check from nf_conntrack_sip
@ 2010-05-14 18:01 Jason Gunthorpe
  2010-05-14 18:13 ` Patrick McHardy
  0 siblings, 1 reply; 10+ messages in thread
From: Jason Gunthorpe @ 2010-05-14 18:01 UTC (permalink / raw)
  To: netfilter-devel, netdev, Patrick McHardy

At least the XEN net front driver always produces non linear skbs,
so the SIP module does nothing at all when used with that NIC.

Unconditionally linearize the skb..

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
---
 net/netfilter/nf_conntrack_sip.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

Patrick/Jan, thanks.. This is what I wanted to do in the first place,
but I couldn't convince myself it was safe, as no other nf code does
this..

Unfortunately I can no longer test it :(
 
diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c
index 4b57216..02d0b59 100644
--- a/net/netfilter/nf_conntrack_sip.c
+++ b/net/netfilter/nf_conntrack_sip.c
@@ -1275,13 +1275,10 @@ static int sip_help(struct sk_buff *skb,
 
 	nf_ct_refresh(ct, skb, sip_timeout * HZ);
 
-	if (!skb_is_nonlinear(skb))
-		dptr = skb->data + dataoff;
-	else {
-		pr_debug("Copy of skbuff not supported yet.\n");
-		return NF_ACCEPT;
-	}
+	if (unlikely(skb_linearize(skb)))
+		return NF_DROP;
 
+	dptr = skb->data + dataoff;
 	datalen = skb->len - dataoff;
 	if (datalen < strlen("SIP/2.0 200"))
 		return NF_ACCEPT;
-- 
1.6.0.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-05-14 19:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-14 18:01 [PATCHv2] netfilter: Remove skb_is_nonlinear check from nf_conntrack_sip Jason Gunthorpe
2010-05-14 18:13 ` Patrick McHardy
2010-05-14 18:26   ` Jason Gunthorpe
2010-05-14 18:42     ` Patrick McHardy
2010-05-14 19:26       ` Patrick McHardy
2010-05-14 19:33         ` Jan Engelhardt
2010-05-14 19:41           ` Patrick McHardy
2010-05-14 19:56       ` Jason Gunthorpe
2010-05-14 18:33   ` Jan Engelhardt
2010-05-14 18:45     ` Patrick McHardy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.