If you have a patched up dhcp server (and dhclient), they will use
AF_PACKET/SOCK_DGRAM pair to send dhcp packets over IPoIB.  This has
worked since forever if you use OFED kernels or one of the distribution
kernels.  However, when testing an upstream kernel, it has been broken
for a very long time (I tested 2.6.34, 2.6.38, 3.0, 3.1, 3.8, HEAD).

It turns out that the hard_header routine in ipoib is not following
the API and is returning 0 even when it pushed data onto the skb.  This
then causes af_packet.c to overwrite the header just pushed with data
from user space.  This header is immediately referenced in the
ipoib_start_xmit routine, so I'm wondering how this ever worked in
distro/ofed kernels that also have this bug, but fixing the bug here
makes things work in upstream kernels.

Signed-off-by: Doug Ledford <dledf...@redhat.com>
---
 drivers/infiniband/ulp/ipoib/ipoib_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c 
b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 8534afd..31dd2a7 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -828,7 +828,7 @@ static int ipoib_hard_header(struct sk_buff *skb,
         */
        memcpy(cb->hwaddr, daddr, INFINIBAND_ALEN);
 
-       return 0;
+       return sizeof *header;
 }
 
 static void ipoib_set_mcast_list(struct net_device *dev)
-- 
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to