diff options
author | Doug Ledford <dledford@redhat.com> | 2013-04-01 17:25:30 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2013-04-17 01:57:09 -0400 |
commit | 83bdd3b96cad1b0c5b8e257ed1f4f38eb2cb844b (patch) | |
tree | 19acb9f581b13d8ca184de5c67341adbcb2c05d6 | |
parent | 41ef2d5678d83af030125550329b6ae8b74618fa (diff) |
IPoIB: Fix ipoib_hard_header() return value
If you have a patched up dhcp server (and dhclient), they will use
AF_PACKET/SOCK_DGRAM pair to send dhcp packets over IPoIB.
However, when testing an upstream kernel, this 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.
Fixing this gets DHCP working on IPoIB.
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 8534afd04e7c..31dd2a7a880f 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, | |||
828 | */ | 828 | */ |
829 | memcpy(cb->hwaddr, daddr, INFINIBAND_ALEN); | 829 | memcpy(cb->hwaddr, daddr, INFINIBAND_ALEN); |
830 | 830 | ||
831 | return 0; | 831 | return sizeof *header; |
832 | } | 832 | } |
833 | 833 | ||
834 | static void ipoib_set_mcast_list(struct net_device *dev) | 834 | static void ipoib_set_mcast_list(struct net_device *dev) |