From: Stephen Hemminger <shemminger@linux-foundation.org>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, bridge@linux-foundation.org
Subject: [PATCH 2/4] bridge: drop PAUSE frames
Date: Wed, 25 Apr 2007 16:47:39 -0700 [thread overview]
Message-ID: <20070425234950.699578312@linux-foundation.org> (raw)
In-Reply-To: 20070425234737.727790594@linux-foundation.org
[-- Attachment #1: bridge-drop-pause.patch --]
[-- Type: text/plain, Size: 1356 bytes --]
Pause frames should never make it out of the network device into
the stack. But if a device was misconfigured, it might happen.
So drop pause frames in bridge.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
--- bridge-2.6.22.orig/include/linux/if_ether.h
+++ bridge-2.6.22/include/linux/if_ether.h
@@ -61,6 +61,7 @@
#define ETH_P_8021Q 0x8100 /* 802.1Q VLAN Extended Header */
#define ETH_P_IPX 0x8137 /* IPX over DIX */
#define ETH_P_IPV6 0x86DD /* IPv6 over bluebook */
+#define ETH_P_PAUSE 0x8808 /* IEEE Pause frames. See 802.3 31B */
#define ETH_P_SLOW 0x8809 /* Slow Protocol. See 802.3ad 43B */
#define ETH_P_WCCP 0x883E /* Web-cache coordination protocol
* defined in draft-wilson-wrec-wccp-v2-00.txt */
--- bridge-2.6.22.orig/net/bridge/br_input.c
+++ bridge-2.6.22/net/bridge/br_input.c
@@ -131,9 +131,14 @@ struct sk_buff *br_handle_frame(struct n
if (!is_valid_ether_addr(eth_hdr(skb)->h_source))
goto drop;
- if (unlikely(is_link_local(dest)))
+ if (unlikely(is_link_local(dest))) {
+ /* Pause frames shouldn't be passed up by driver anyway */
+ if (skb->protocol == htons(ETH_P_PAUSE))
+ goto drop;
+
return (NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_IN, skb, skb->dev,
NULL, br_handle_local_finish) == 0) ? skb : NULL;
+ }
switch (p->state) {
case BR_STATE_FORWARDING:
--
next prev parent reply other threads:[~2007-04-25 23:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-25 23:47 [PATCH 0/4] Bridge patches for 2.6.22 Stephen Hemminger
2007-04-25 23:47 ` [PATCH 1/4] bridge: don't change packet type Stephen Hemminger
2007-04-26 5:05 ` David Miller
2007-04-25 23:47 ` Stephen Hemminger [this message]
2007-04-26 5:07 ` [PATCH 2/4] bridge: drop PAUSE frames David Miller
2007-04-25 23:47 ` [PATCH 3/4] bridge: if no STP then forward all BPDUs Stephen Hemminger
2007-04-25 23:47 ` [PATCH 4/4] bridge: missing rtnl Stephen Hemminger
2007-04-26 5:08 ` David Miller
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=20070425234950.699578312@linux-foundation.org \
--to=shemminger@linux-foundation.org \
--cc=bridge@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.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).