Commit:     f3ec75f627c746cfe460482d38a33b06a84d038f
Parent:     e06e7c615877026544ad7f8b309d1a3706410383
Author:     Allan Stephens <[EMAIL PROTECTED]>
AuthorDate: Sun Jun 10 17:24:20 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Tue Jul 10 22:06:02 2007 -0700

    [TIPC]: Improved support for Ethernet traffic filtering
    This patch simplifies TIPC's Ethernet receive routine to take
    advantage of information already present in each incoming sk_buff
    indicating whether the packet was explicitly sent to the interface,
    has been broadcast to all interfaces, or was picked up because the
    interface is in promiscous mode.
    This new approach also fixes the problem of TIPC accepting unwanted
    traffic through UML's multicast-based Ethernet interfaces (which
    deliver traffic in a promiscuous manner even if the interface is
    not configured to be promiscuous).
    Signed-off-by: Allan Stephens <[EMAIL PROTECTED]>
    Signed-off-by: Jon Paul Maloy <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
 net/tipc/eth_media.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c
index 77d2d9c..711ca4b 100644
--- a/net/tipc/eth_media.c
+++ b/net/tipc/eth_media.c
@@ -1,8 +1,8 @@
  * net/tipc/eth_media.c: Ethernet bearer support for TIPC
- * Copyright (c) 2001-2006, Ericsson AB
- * Copyright (c) 2005-2006, Wind River Systems
+ * Copyright (c) 2001-2007, Ericsson AB
+ * Copyright (c) 2005-2007, Wind River Systems
  * All rights reserved.
  * Redistribution and use in source and binary forms, with or without
@@ -87,6 +87,9 @@ static int send_msg(struct sk_buff *buf, struct tipc_bearer 
  * recv_msg - handle incoming TIPC message from an Ethernet interface
+ * Accept only packets explicitly sent to this node, or broadcast packets;
+ * ignores packets sent using Ethernet multicast, and traffic sent to other
+ * nodes (which can happen if interface is running in promiscuous mode).
  * Routine truncates any Ethernet padding/CRC appended to the message,
  * and ensures message size matches actual length
@@ -98,9 +101,7 @@ static int recv_msg(struct sk_buff *buf, struct net_device 
        u32 size;
        if (likely(eb_ptr->bearer)) {
-              if (likely(!dev->promiscuity) ||
-                  !memcmp(skb_mac_header(buf), dev->dev_addr, ETH_ALEN) ||
-                  !memcmp(skb_mac_header(buf), dev->broadcast, ETH_ALEN)) {
+               if (likely(buf->pkt_type <= PACKET_BROADCAST)) {
                        size = msg_size((struct tipc_msg *)buf->data);
                        skb_trim(buf, size);
                        if (likely(buf->len == size)) {
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to