From patchwork Tue Sep 25 06:21:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 186695 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 E14A62C0081 for ; Tue, 25 Sep 2012 16:21:50 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753276Ab2IYGVX (ORCPT ); Tue, 25 Sep 2012 02:21:23 -0400 Received: from mail-bk0-f46.google.com ([209.85.214.46]:37678 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753259Ab2IYGVW (ORCPT ); Tue, 25 Sep 2012 02:21:22 -0400 Received: by bkcjk13 with SMTP id jk13so1321532bkc.19 for ; Mon, 24 Sep 2012 23:21:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; bh=2y2zLqtDstruqZ4gBXzV3fhtRHbcjQSjWtamR6ueP2E=; b=YSOcZ8GI82Gq0t9gjqvZ8hWqKaJni+4Q7niWt93Gf25SQlul03cu25M3HgLjFxHrH2 BZnNMgxnrbsWzyuCezGjMcRSxWEgyTbmv5ECAWiMe29ebc9e2tMYqZZwZype4JZqQTXZ 7MQWWDxqBRL/Ngu+Yj+vzynzsQQqYCm2ZIIxhlYS2wwoui5OdqA6kFmXFPFvgFZZYDO4 i/hIfod36/5oKbNl00zVnxXopu1pRAPkeXj39l3uMoLoqcfFQSPr4pml/40pNHHRztE7 PbnJLx5SrQvAgyrzoo28WCA5XwXYGz4npAcguw/8xkXp0Fk5hVV7EUsoCmxn8xJLsLTr Nr5Q== Received: by 10.204.4.129 with SMTP id 1mr5528047bkr.58.1348554080018; Mon, 24 Sep 2012 23:21:20 -0700 (PDT) Received: from [172.28.90.180] ([172.28.90.180]) by mx.google.com with ESMTPS id gy18sm2884316bkc.4.2012.09.24.23.21.17 (version=SSLv3 cipher=OTHER); Mon, 24 Sep 2012 23:21:18 -0700 (PDT) Subject: [PATCH net-next] net: raw: revert unrelated change From: Eric Dumazet To: David Miller Cc: sfr@canb.auug.org.au, netdev@vger.kernel.org, linux-next@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <1348550602.26828.1918.camel@edumazet-glaptop> References: <20120925123438.bbf3126889513ee5cc195e5c@canb.auug.org.au> <1348549842.26828.1897.camel@edumazet-glaptop> <20120925.011343.1495275645575636949.davem@davemloft.net> <1348550602.26828.1918.camel@edumazet-glaptop> Date: Tue, 25 Sep 2012 08:21:16 +0200 Message-ID: <1348554076.26828.1990.camel@edumazet-glaptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Eric Dumazet Commit 5640f7685831 ("net: use a per task frag allocator") accidentally contained an unrelated change to net/ipv4/raw.c, later committed (without the pr_err() debugging bits) in net tree as commit ab43ed8b749 (ipv4: raw: fix icmp_filter()) This patch reverts this glitch, noticed by Stephen Rothwell. Reported-by: Stephen Rothwell Signed-off-by: Eric Dumazet --- net/ipv4/raw.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) -- 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 diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index a80740b..f242578 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c @@ -131,23 +131,18 @@ found: * 0 - deliver * 1 - block */ -static int icmp_filter(const struct sock *sk, const struct sk_buff *skb) +static __inline__ int icmp_filter(struct sock *sk, struct sk_buff *skb) { - struct icmphdr _hdr; - const struct icmphdr *hdr; - - pr_err("icmp_filter skb_transport_offset %d data-head %ld len %d/%d\n", - skb_transport_offset(skb), skb->data - skb->head, skb->len, skb->data_len); - hdr = skb_header_pointer(skb, skb_transport_offset(skb), - sizeof(_hdr), &_hdr); - pr_err("head %p data %p hdr %p type %d\n", skb->head, skb->data, hdr, hdr ? hdr->type : -1); - if (!hdr) + int type; + + if (!pskb_may_pull(skb, sizeof(struct icmphdr))) return 1; - if (hdr->type < 32) { + type = icmp_hdr(skb)->type; + if (type < 32) { __u32 data = raw_sk(sk)->filter.data; - return ((1U << hdr->type) & data) != 0; + return ((1 << type) & data) != 0; } /* Do not block unknown ICMP types */