netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Bart De Schuymer <bdschuym@pandora.be>
Cc: Netfilter Developer Mailing List
	<netfilter-devel@vger.kernel.org>,
	Stephen Hemminger <shemminger@linux-foundation.org>
Subject: Re: [PATCH/RFC 3/5] bridge-netfilter: simplify IP DNAT and fix IP DNAT on encapsulated packets
Date: Tue, 13 Apr 2010 11:44:36 +0200	[thread overview]
Message-ID: <4BC43D04.2040808@trash.net> (raw)
In-Reply-To: <4BB207A8.6000608@pandora.be>

Bart De Schuymer wrote:
> --- linux-2.6.33/net/bridge/br_device.c	2010-02-24 19:52:17.000000000 +0100
> +++ linux-2.6.33-uml/net/bridge/br_device.c	2010-03-30 14:15:19.000000000 +0200
> @@ -15,7 +15,7 @@
>  #include <linux/netdevice.h>
>  #include <linux/etherdevice.h>
>  #include <linux/ethtool.h>
> -
> +#include <linux/netfilter_bridge.h>
>  #include <asm/uaccess.h>
>  #include "br_private.h"
>  
> @@ -26,12 +26,19 @@ netdev_tx_t br_dev_xmit(struct sk_buff *
>  	const unsigned char *dest = skb->data;
>  	struct net_bridge_fdb_entry *dst;
>  
> -	dev->stats.tx_packets++;
> -	dev->stats.tx_bytes += skb->len;
> -
>  	skb_reset_mac_header(skb);
>  	skb_pull(skb, ETH_HLEN);
>  
> +#ifdef CONFIG_BRIDGE_NETFILTER
> +	if (skb->nf_bridge && (skb->nf_bridge->mask & BRNF_BRIDGED_DNAT)) {
> +		br_nf_pre_routing_finish_bridge_slow(skb);
> +		return NETDEV_TX_OK;
> +	}
> +#endif
> +
> +	dev->stats.tx_packets++;
> +	dev->stats.tx_bytes += skb->len;

This changes how packets are counted by moving the statistics
update after the skb_pull() call.

      parent reply	other threads:[~2010-04-13  9:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-30 14:16 [PATCH/RFC 3/5] bridge-netfilter: simplify IP DNAT and fix IP DNAT on encapsulated packets Bart De Schuymer
2010-04-08 12:31 ` Patrick McHardy
2010-04-08 13:27   ` Bart De Schuymer
2010-04-08 13:28     ` Patrick McHardy
2010-04-13  9:44 ` Patrick McHardy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BC43D04.2040808@trash.net \
    --to=kaber@trash.net \
    --cc=bdschuym@pandora.be \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=shemminger@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).