Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 157372
b: refs/heads/master
c: 5e47596
h: refs/heads/master
v: v3
  • Loading branch information
Jason Gunthorpe authored and Roland Dreier committed Sep 6, 2009
1 parent 943d883 commit e1ee1de
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 721d67cdca5b7642b380ca0584de8dceecf6102f
refs/heads/master: 5e47596bee12597824a3b5b21e20f80b61e58a35
19 changes: 19 additions & 0 deletions trunk/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,20 @@ void ipoib_mcast_dev_flush(struct net_device *dev)
}
}

static int ipoib_mcast_addr_is_valid(const u8 *addr, unsigned int addrlen,
const u8 *broadcast)
{
if (addrlen != INFINIBAND_ALEN)
return 0;
/* reserved QPN, prefix, scope */
if (memcmp(addr, broadcast, 6))
return 0;
/* signature lower, pkey */
if (memcmp(addr + 7, broadcast + 7, 3))
return 0;
return 1;
}

void ipoib_mcast_restart_task(struct work_struct *work)
{
struct ipoib_dev_priv *priv =
Expand Down Expand Up @@ -793,6 +807,11 @@ void ipoib_mcast_restart_task(struct work_struct *work)
for (mclist = dev->mc_list; mclist; mclist = mclist->next) {
union ib_gid mgid;

if (!ipoib_mcast_addr_is_valid(mclist->dmi_addr,
mclist->dmi_addrlen,
dev->broadcast))
continue;

memcpy(mgid.raw, mclist->dmi_addr + 4, sizeof mgid);

mcast = __ipoib_mcast_find(dev, &mgid);
Expand Down

0 comments on commit e1ee1de

Please sign in to comment.