From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: ip6_forward / NF_HOOK and counters Date: Fri, 30 Mar 2018 09:06:52 -0600 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: Jeff Barnhill <0xeffeff@gmail.com>, netdev@vger.kernel.org Return-path: Received: from mail-pf0-f172.google.com ([209.85.192.172]:44310 "EHLO mail-pf0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751180AbeC3PMN (ORCPT ); Fri, 30 Mar 2018 11:12:13 -0400 Received: by mail-pf0-f172.google.com with SMTP id m68so5560575pfm.11 for ; Fri, 30 Mar 2018 08:12:12 -0700 (PDT) In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 3/26/18 7:35 PM, Jeff Barnhill wrote: > At the end of ip6_forward(), is there a good reason why > IPSTATS_MIB_OUTFORWDATAGRAMS and IPSTATS_MIB_OUTOCTETS are incremented > before the NF_HOOK? If the hook steals or drops the packet, this > counts still go up, which seems incorrect. > > v4/ip_forward() increments these counters in ip_forward_finish(). It > seems that v6 should do it in ip6_forward_finish() ?? Thoughts? > > Jeff > I agree and think it is part of the alignment between IPv4 and IPv6.