提交 5e3c8854 编写于 作者: J Jon Maloy 提交者: David S. Miller

[TIPC] Improved tolerance to promiscuous mode interface

Signed-off-by: NJon Maloy <jon.maloy@ericsson.com>
Signed-off-by: NPer Liden <per.liden@ericsson.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 fcc18e83
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册