Ethernet Bridge development
 help / color / mirror / Atom feed
From: Dirk Morris <dmorris@metaloft.com>
To: bridge@lists.osdl.org
Subject: [Bridge] mac table updates
Date: Thu, 28 Jul 2005 16:23:43 -0700	[thread overview]
Message-ID: <42E968FF.6000607@metaloft.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 633 bytes --]

I think the new mac ageing (sometime since 2.6.8.1) may be too aggressive.
Now it updates the table at a much later time, with a comment in the 
code that leads me to believe
this is to prevent counting spoofed packets and a DOS.

My problem is that the update occurs after the netfilter hooks which may 
do weird things to change the course of the packet so that it does not 
get counted.
(in my case, redirecting, queueing to userspace, nonlocally bound 
sockets, etc).
For me this causes packets to go spewing out on the wrong interface when 
the timer expires.

I used the attached patch to revert back to the old method.

-Dirk

[-- Attachment #2: bridge-mac-ageing-fix.patch --]
[-- Type: text/x-patch, Size: 545 bytes --]

diff -urN linux-2.6.12.3/net/bridge/br_input.c linux-2.6.12.3-bridgefix/net/bridge/br_input.c
--- linux-2.6.12.3/net/bridge/br_input.c	2005-07-15 14:18:57.000000000 -0700
+++ linux-2.6.12.3-bridgefix/net/bridge/br_input.c	2005-07-25 23:19:30.903355408 -0700
@@ -111,7 +111,8 @@
 	if (!is_valid_ether_addr(eth_hdr(skb)->h_source))
 		goto err;
 
-	if (p->state == BR_STATE_LEARNING)
+	if (p->state == BR_STATE_LEARNING ||
+        p->state == BR_STATE_FORWARDING)
 		br_fdb_update(p->br, p, eth_hdr(skb)->h_source);
 
 	if (p->br->stp_enabled &&

             reply	other threads:[~2005-07-28 23:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-28 23:23 Dirk Morris [this message]
2005-07-29  4:33 ` [Bridge] mac table updates Stephen Hemminger
2005-07-29 16:43   ` Dirk Morris

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=42E968FF.6000607@metaloft.com \
    --to=dmorris@metaloft.com \
    --cc=bridge@lists.osdl.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