[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>
This commit is contained in:
committed by
David S. Miller
parent
fcc18e83e1
commit
5e3c8854c1
@@ -98,17 +98,19 @@ static int recv_msg(struct sk_buff *buf, struct net_device *dev,
|
|||||||
u32 size;
|
u32 size;
|
||||||
|
|
||||||
if (likely(eb_ptr->bearer)) {
|
if (likely(eb_ptr->bearer)) {
|
||||||
size = msg_size((struct tipc_msg *)buf->data);
|
if (likely(!dev->promiscuity) ||
|
||||||
skb_trim(buf, size);
|
!memcmp(buf->mac.raw,dev->dev_addr,ETH_ALEN) ||
|
||||||
if (likely(buf->len == size)) {
|
!memcmp(buf->mac.raw,dev->broadcast,ETH_ALEN)) {
|
||||||
buf->next = NULL;
|
size = msg_size((struct tipc_msg *)buf->data);
|
||||||
tipc_recv_msg(buf, eb_ptr->bearer);
|
skb_trim(buf, size);
|
||||||
} else {
|
if (likely(buf->len == size)) {
|
||||||
kfree_skb(buf);
|
buf->next = NULL;
|
||||||
|
tipc_recv_msg(buf, eb_ptr->bearer);
|
||||||
|
return TIPC_OK;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
kfree_skb(buf);
|
|
||||||
}
|
}
|
||||||
|
kfree_skb(buf);
|
||||||
return TIPC_OK;
|
return TIPC_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user