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 -1
+1 -1
drivers/infiniband/ulp/ipoib/ipoib_main.c
··· 723 723 * destination address onto the front of the skb so we can 724 724 * figure out where to send the packet later. 725 725 */ 726 - if (!skb->dst || !skb->dst->neighbour) { 726 + if ((!skb->dst || !skb->dst->neighbour) && daddr) { 727 727 struct ipoib_pseudoheader *phdr = 728 728 (struct ipoib_pseudoheader *) skb_push(skb, sizeof *phdr); 729 729 memcpy(phdr->hwaddr, daddr, INFINIBAND_ALEN);