From patchwork Fri May 14 18:13:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick McHardy X-Patchwork-Id: 52656 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 68505B7E53 for ; Sat, 15 May 2010 04:13:14 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757089Ab0ENSNG (ORCPT ); Fri, 14 May 2010 14:13:06 -0400 Received: from stinky.trash.net ([213.144.137.162]:50187 "EHLO stinky.trash.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754833Ab0ENSNE (ORCPT ); Fri, 14 May 2010 14:13:04 -0400 Received: from [192.168.0.100] (unknown [78.42.107.241]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by stinky.trash.net (Postfix) with ESMTPSA id 33068B2C5A; Fri, 14 May 2010 20:13:03 +0200 (MEST) Message-ID: <4BED92AF.50704@trash.net> Date: Fri, 14 May 2010 20:13:03 +0200 From: Patrick McHardy User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090701) MIME-Version: 1.0 To: Jason Gunthorpe CC: netfilter-devel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCHv2] netfilter: Remove skb_is_nonlinear check from nf_conntrack_sip References: <20100514180138.GF15969@obsidianresearch.com> In-Reply-To: <20100514180138.GF15969@obsidianresearch.com> X-Enigmail-Version: 0.95.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Jason Gunthorpe wrote: > 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.. Your patch is based on an old version, the current version also supports TCP. I'll commit this patch to my tree after some testing. diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c index b20f427..45750cc 100644 --- a/net/netfilter/nf_conntrack_sip.c +++ b/net/netfilter/nf_conntrack_sip.c @@ -1393,10 +1393,8 @@ static int sip_help_tcp(struct sk_buff *skb, unsigned int protoff, nf_ct_refresh(ct, skb, sip_timeout * HZ); - if (skb_is_nonlinear(skb)) { - pr_debug("Copy of skbuff not supported yet.\n"); + if (unlikely(skb_linearize(skb))) return NF_ACCEPT; - } dptr = skb->data + dataoff; datalen = skb->len - dataoff; @@ -1455,10 +1453,8 @@ static int sip_help_udp(struct sk_buff *skb, unsigned int protoff, nf_ct_refresh(ct, skb, sip_timeout * HZ); - if (skb_is_nonlinear(skb)) { - pr_debug("Copy of skbuff not supported yet.\n"); + if (unlikely(skb_linearize(skb))) return NF_ACCEPT; - } dptr = skb->data + dataoff; datalen = skb->len - dataoff;