Skip to content

Commit

Permalink
[TIPC] Improved tolerance to promiscuous mode interface
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jon Maloy authored and David S. Miller committed Jun 26, 2006
1 parent fcc18e8 commit 5e3c885
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions net/tipc/eth_media.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 5e3c885

Please sign in to comment.