Skip to content

Commit ef12d45

Browse files
author
Roland Dreier
committed
IPoIB: Fix oops with raw sockets
ipoib_hard_header() needs to handle the case that daddr is NULL. This can happen when packets are injected via a raw socket, and IPoIB shouldn't oops in this case. Reported by Anton Blanchard <anton@samba.org> Signed-off-by: Roland Dreier <rolandd@cisco.com>
1 parent a07bacc commit ef12d45

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/infiniband/ulp/ipoib/ipoib_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ static int ipoib_hard_header(struct sk_buff *skb,
723723
* destination address onto the front of the skb so we can
724724
* figure out where to send the packet later.
725725
*/
726-
if (!skb->dst || !skb->dst->neighbour) {
726+
if ((!skb->dst || !skb->dst->neighbour) && daddr) {
727727
struct ipoib_pseudoheader *phdr =
728728
(struct ipoib_pseudoheader *) skb_push(skb, sizeof *phdr);
729729
memcpy(phdr->hwaddr, daddr, INFINIBAND_ALEN);

0 commit comments

Comments
 (0)