From patchwork Thu Mar 1 21:39:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Weinberger X-Patchwork-Id: 144118 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 167E81007D6 for ; Fri, 2 Mar 2012 08:39:30 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965068Ab2CAVj2 (ORCPT ); Thu, 1 Mar 2012 16:39:28 -0500 Received: from a.ns.miles-group.at ([95.130.255.143]:47834 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965064Ab2CAVj1 (ORCPT ); Thu, 1 Mar 2012 16:39:27 -0500 Received: (qmail 23802 invoked by uid 89); 1 Mar 2012 21:39:24 -0000 Received: by simscan 1.3.1 ppid: 23795, pid: 23798, t: 0.1202s scanners: attach: 1.3.1 clamav: 0.96.5/m:53 Received: from unknown (HELO ?192.168.0.2?) (richard@nod.at@212.183.100.192) by radon.swed.at with ESMTPA; 1 Mar 2012 21:39:24 -0000 Message-ID: <4F4FEC83.6090504@nod.at> Date: Thu, 01 Mar 2012 22:39:15 +0100 From: Richard Weinberger User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Pablo Neira Ayuso CC: netfilter-devel@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, eric.dumazet@gmail.com, jengelh@medozas.de, rostedt@goodmis.org Subject: Re: [PATCH 1/4] Netfilter: Merge ipt_LOG and ip6_LOG into xt_LOG References: <1328400892-22409-1-git-send-email-richard@nod.at> <1328400892-22409-3-git-send-email-richard@nod.at> <20120301112732.GA6806@1984> In-Reply-To: <20120301112732.GA6806@1984> X-Enigmail-Version: 1.3.4 Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Am 01.03.2012 12:27, schrieb Pablo Neira Ayuso: > While merging ipt_LOG and ip6t_LOG, you introduced some bug that > corrupts the log line. Note the extra PROTO=, I don't have any UDPLITE > traffic here. > > Looks like a missing break in one switch. I got confused by my own logic. :-\ Does the attached patch fix the issue? It's based on "Netfilter: xt_LOG: Add timestamp support". Thanks, //richard diff --git a/net/netfilter/xt_LOG.c b/net/netfilter/xt_LOG.c index 4e392cf..019fb64 100644 --- a/net/netfilter/xt_LOG.c +++ b/net/netfilter/xt_LOG.c @@ -269,12 +269,14 @@ static void dump_ipv4_packet(struct sbuff *m, ntohs(ih->frag_off) & IP_OFFSET, iphoff+ih->ihl*4, logflags)) return; + break; case IPPROTO_UDP: case IPPROTO_UDPLITE: if (dump_udp_header(m, skb, ih->protocol, ntohs(ih->frag_off) & IP_OFFSET, iphoff+ih->ihl*4)) return; + break; case IPPROTO_ICMP: { struct icmphdr _icmph; const struct icmphdr *ich; @@ -723,10 +725,12 @@ static void dump_ipv6_packet(struct sbuff *m, if (dump_tcp_header(m, skb, currenthdr, fragment, ptr, logflags)) return; + break; case IPPROTO_UDP: case IPPROTO_UDPLITE: if (dump_udp_header(m, skb, currenthdr, fragment, ptr)) return; + break; case IPPROTO_ICMPV6: { struct icmp6hdr _icmp6h; const struct icmp6hdr *ic;