diff options
author | Jon Maloy <jon.maloy@ericsson.com> | 2006-06-26 02:36:43 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-06-26 02:36:43 -0400 |
commit | 5e3c8854c1898828ffb0141d4ac4e6190aa9eb4e (patch) | |
tree | 37d58dc51a1d3f7bc7f2fef26397563bb38bfaa9 /net/tipc/eth_media.c | |
parent | fcc18e83e1f6fd9fa6b333735bf0fcd530655511 (diff) |
[TIPC] Improved tolerance to promiscuous mode interface
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Per Liden <per.liden@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/eth_media.c')
-rw-r--r-- | net/tipc/eth_media.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c index 7a252785f727..b64661904e0d 100644 --- a/net/tipc/eth_media.c +++ b/net/tipc/eth_media.c | |||
@@ -98,17 +98,19 @@ static int recv_msg(struct sk_buff *buf, struct net_device *dev, | |||
98 | u32 size; | 98 | u32 size; |
99 | 99 | ||
100 | if (likely(eb_ptr->bearer)) { | 100 | if (likely(eb_ptr->bearer)) { |
101 | size = msg_size((struct tipc_msg *)buf->data); | 101 | if (likely(!dev->promiscuity) || |
102 | skb_trim(buf, size); | 102 | !memcmp(buf->mac.raw,dev->dev_addr,ETH_ALEN) || |
103 | if (likely(buf->len == size)) { | 103 | !memcmp(buf->mac.raw,dev->broadcast,ETH_ALEN)) { |
104 | buf->next = NULL; | 104 | size = msg_size((struct tipc_msg *)buf->data); |
105 | tipc_recv_msg(buf, eb_ptr->bearer); | 105 | skb_trim(buf, size); |
106 | } else { | 106 | if (likely(buf->len == size)) { |
107 | kfree_skb(buf); | 107 | buf->next = NULL; |
108 | tipc_recv_msg(buf, eb_ptr->bearer); | ||
109 | return TIPC_OK; | ||
110 | } | ||
108 | } | 111 | } |
109 | } else { | ||
110 | kfree_skb(buf); | ||
111 | } | 112 | } |
113 | kfree_skb(buf); | ||
112 | return TIPC_OK; | 114 | return TIPC_OK; |
113 | } | 115 | } |
114 | 116 | ||