From: Jon Maloy Date: Mon, 26 Jun 2006 06:36:43 +0000 (-0700) Subject: [TIPC] Improved tolerance to promiscuous mode interface X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5e3c8854c1898828ffb0141d4ac4e6190aa9eb4e;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [TIPC] Improved tolerance to promiscuous mode interface Signed-off-by: Jon Maloy Signed-off-by: Per Liden Signed-off-by: David S. Miller --- 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, u32 size; if (likely(eb_ptr->bearer)) { - size = msg_size((struct tipc_msg *)buf->data); - skb_trim(buf, size); - if (likely(buf->len == size)) { - buf->next = NULL; - tipc_recv_msg(buf, eb_ptr->bearer); - } else { - kfree_skb(buf); + if (likely(!dev->promiscuity) || + !memcmp(buf->mac.raw,dev->dev_addr,ETH_ALEN) || + !memcmp(buf->mac.raw,dev->broadcast,ETH_ALEN)) { + size = msg_size((struct tipc_msg *)buf->data); + skb_trim(buf, size); + if (likely(buf->len == size)) { + buf->next = NULL; + tipc_recv_msg(buf, eb_ptr->bearer); + return TIPC_OK; + } } - } else { - kfree_skb(buf); } + kfree_skb(buf); return TIPC_OK; }