summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2010-02-27 15:07:33 +0300
committerDavid S. Miller <davem@davemloft.net>2010-02-28 12:34:28 +0300
commit6c74651c3bce418d3b29edfdeb72664f9441509a (patch)
treee61887ade4d194023708746c05461402b41e7fd0
parentcf0aa4e07c32b0c211c24742aa015c0e7a135293 (diff)
downloadlinux-6c74651c3bce418d3b29edfdeb72664f9441509a.tar.xz
ipoib: returned back addrlen check for mc addresses
Apparently bogus mc address can break IPOIB multicast processing. Therefore returning the check for addrlen back until this is resolved in bonding (I don't see any other point from where mc address with non-dev->addr_len length can came from). Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_multicast.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
index 19eba3c877cb..d41ea27be5e1 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -767,8 +767,11 @@ void ipoib_mcast_dev_flush(struct net_device *dev)
}
}
-static int ipoib_mcast_addr_is_valid(const u8 *addr, const u8 *broadcast)
+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;
@@ -812,6 +815,7 @@ void ipoib_mcast_restart_task(struct work_struct *work)
union ib_gid mgid;
if (!ipoib_mcast_addr_is_valid(mclist->dmi_addr,
+ mclist->dmi_addrlen,
dev->broadcast))
continue;