From patchwork Fri May 14 18:01:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 52654 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A3FC3B7EAB for ; Sat, 15 May 2010 04:01:50 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758818Ab0ENSBp (ORCPT ); Fri, 14 May 2010 14:01:45 -0400 Received: from [139.142.54.143] ([139.142.54.143]:53166 "EHLO quartz.orcorp.ca" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1758608Ab0ENSBo (ORCPT ); Fri, 14 May 2010 14:01:44 -0400 Received: from [10.0.0.11] (helo=jggl.edm.orcorp.ca) by quartz.orcorp.ca with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.68) (envelope-from ) id 1OCzCc-0006yj-OI; Fri, 14 May 2010 12:01:38 -0600 Received: from jgg by jggl.edm.orcorp.ca with local (Exim 4.69) (envelope-from ) id 1OCzCc-0004Af-MG; Fri, 14 May 2010 12:01:38 -0600 Date: Fri, 14 May 2010 12:01:38 -0600 From: Jason Gunthorpe To: netfilter-devel@vger.kernel.org, netdev@vger.kernel.org, Patrick McHardy Subject: [PATCHv2] netfilter: Remove skb_is_nonlinear check from nf_conntrack_sip Message-ID: <20100514180138.GF15969@obsidianresearch.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-Broken-Reverse-DNS: no host name found for IP address 10.0.0.11 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- 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;