diff mbox

[net-next-2.6] ipoib: remove addrlen check for mc addresses

Message ID 20100322132138.GC2780@psychotron.lab.eng.brq.redhat.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Jiri Pirko March 22, 2010, 1:21 p.m. UTC
Finally this bit can be removed. Currently, after the bonding driver is
changed/fixed (32a806c194ea112cfab00f558482dd97bee5e44e net-next-2.6),
that's not possible for an addr with different length than dev->addr_len
to be present in list. Removing this check as in new mc_list there will be
no addrlen in the record.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
 drivers/infiniband/ulp/ipoib/ipoib_multicast.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

Comments

Jason Gunthorpe March 22, 2010, 4:59 p.m. UTC | #1
On Mon, Mar 22, 2010 at 02:21:39PM +0100, Jiri Pirko wrote:
> Finally this bit can be removed. Currently, after the bonding driver is
> changed/fixed (32a806c194ea112cfab00f558482dd97bee5e44e net-next-2.6),
> that's not possible for an addr with different length than dev->addr_len
> to be present in list. Removing this check as in new mc_list there will be
> no addrlen in the record.

Maybe just make this check a WARN_ON? Can userspace create a mc_list
entry with the wrong size via netlink?

Jason
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jiri Pirko March 22, 2010, 5:26 p.m. UTC | #2
Mon, Mar 22, 2010 at 05:59:16PM CET, jgunthorpe@obsidianresearch.com wrote:
>On Mon, Mar 22, 2010 at 02:21:39PM +0100, Jiri Pirko wrote:
>> Finally this bit can be removed. Currently, after the bonding driver is
>> changed/fixed (32a806c194ea112cfab00f558482dd97bee5e44e net-next-2.6),
>> that's not possible for an addr with different length than dev->addr_len
>> to be present in list. Removing this check as in new mc_list there will be
>> no addrlen in the record.
>
>Maybe just make this check a WARN_ON?

As I said, addrlen will no longer be in record (because it would have no
meaning since length ot the addr is always dev->addr_len)

>Can userspace create a mc_list
>entry with the wrong size via netlink?

Nope - this is not possible. dev->addr_len is used.

>
>Jason
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jason Gunthorpe March 22, 2010, 5:46 p.m. UTC | #3
On Mon, Mar 22, 2010 at 06:26:14PM +0100, Jiri Pirko wrote:
> Mon, Mar 22, 2010 at 05:59:16PM CET, jgunthorpe@obsidianresearch.com wrote:
> >On Mon, Mar 22, 2010 at 02:21:39PM +0100, Jiri Pirko wrote:
> >> Finally this bit can be removed. Currently, after the bonding driver is
> >> changed/fixed (32a806c194ea112cfab00f558482dd97bee5e44e net-next-2.6),
> >> that's not possible for an addr with different length than dev->addr_len
> >> to be present in list. Removing this check as in new mc_list there will be
> >> no addrlen in the record.
> >
> >Maybe just make this check a WARN_ON?
> 
> As I said, addrlen will no longer be in record (because it would have no
> meaning since length ot the addr is always dev->addr_len)

Oh, I see, sounds good then

Jason
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller March 23, 2010, 1:34 a.m. UTC | #4
From: Jiri Pirko <jpirko@redhat.com>
Date: Mon, 22 Mar 2010 18:26:14 +0100

> Mon, Mar 22, 2010 at 05:59:16PM CET, jgunthorpe@obsidianresearch.com wrote:
>>On Mon, Mar 22, 2010 at 02:21:39PM +0100, Jiri Pirko wrote:
>>> Finally this bit can be removed. Currently, after the bonding driver is
>>> changed/fixed (32a806c194ea112cfab00f558482dd97bee5e44e net-next-2.6),
>>> that's not possible for an addr with different length than dev->addr_len
>>> to be present in list. Removing this check as in new mc_list there will be
>>> no addrlen in the record.
>>
>>Maybe just make this check a WARN_ON?
> 
> As I said, addrlen will no longer be in record (because it would have no
> meaning since length ot the addr is always dev->addr_len)
> 
>>Can userspace create a mc_list
>>entry with the wrong size via netlink?
> 
> Nope - this is not possible. dev->addr_len is used.

I've applied your patch, thanks Jiri.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Eli Cohen March 23, 2010, 10:30 a.m. UTC | #5
On Mon, Mar 22, 2010 at 02:21:39PM +0100, Jiri Pirko wrote:
> Finally this bit can be removed. Currently, after the bonding driver is
> changed/fixed (32a806c194ea112cfab00f558482dd97bee5e44e net-next-2.6),

Could you send a link to the git tree where I can find this commit and
the related fixes?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Or Gerlitz March 23, 2010, 10:34 a.m. UTC | #6
Eli Cohen wrote:
> Could you send a link to the git tree where I can find this commit and
> the related fixes?

basically, as the subject line suggests, it should be in Dave's net-next tree

Or.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Moni Shoua March 23, 2010, 10:46 a.m. UTC | #7
> Could you send a link to the git tree where I can find this commit and
> the related fixes?
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
See commit 5e47596bee12597824a3b5b21e20f80b61e58a35 for the fix prior to this one.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Eli Cohen March 23, 2010, 11:34 a.m. UTC | #8
On Tue, Mar 23, 2010 at 12:34:13PM +0200, Or Gerlitz wrote:
> 
> basically, as the subject line suggests, it should be in Dave's net-next tree
> 
I just need to clone this tree and need the url. Can you give it to me
from .git/config?
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Moni Shoua March 23, 2010, 11:45 a.m. UTC | #9
Eli Cohen wrote:
> On Tue, Mar 23, 2010 at 12:34:13PM +0200, Or Gerlitz wrote:
>> basically, as the subject line suggests, it should be in Dave's net-next tree
>>
> I just need to clone this tree and need the url. Can you give it to me
> from .git/config?
> Thanks.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
maybe your'e looking for this one
http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=commit;h=32a806c194ea112cfab00f558482dd97bee5e44e

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Moni Shoua March 23, 2010, 11:55 a.m. UTC | #10
> maybe your'e looking for this one
> http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=commit;h=32a806c194ea112cfab00f558482dd97bee5e44e

This is the link to the related patch of course but it also tells you which tree to clone
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
index d41ea27..19eba3c 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -767,11 +767,8 @@  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)
+static int ipoib_mcast_addr_is_valid(const u8 *addr, const u8 *broadcast)
 {
-	if (addrlen != INFINIBAND_ALEN)
-		return 0;
 	/* reserved QPN, prefix, scope */
 	if (memcmp(addr, broadcast, 6))
 		return 0;
@@ -815,7 +812,6 @@  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;