]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
IB/ipoib: Filter RX packets before adding pseudo header
authorYuval Shaia <yuval.shaia@oracle.com>
Thu, 6 Sep 2018 11:11:16 +0000 (04:11 -0700)
committerBrian Maly <brian.maly@oracle.com>
Wed, 26 Sep 2018 00:29:29 +0000 (20:29 -0400)
IB-ACL filtering is based on SGID (carried in the GRH).
The function skb_add_pseudo_hdr clears the SGID from the header.

Doing filtering after this call has no effect since all packets will drop
for not having SGID in.

Fix this by moving the call to skb_add_pseudo_hdr to be after IB-ACL
filtering while still adjusting skb->data as needed for the filtering.

Orabug: 28655409

Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Reviewed-by: HÃ¥kon Bugge <haakon.bugge@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/infiniband/ulp/ipoib/ipoib_ib.c

index 974eeb9fcd2958ce7ac82fcfa99b07b7f2ac04e3..11456e2d68e240e6b9e109e63e9de607ee7d501f 100644 (file)
@@ -280,7 +280,7 @@ static void ipoib_ib_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
        skb_pull(skb, IB_GRH_BYTES);
 
        skb->protocol = ((struct ipoib_header *) skb->data)->proto;
-       skb_add_pseudo_hdr(skb);
+       skb_pull(skb, IPOIB_ENCAP_LEN);
 
        skb->truesize = SKB_TRUESIZE(skb->len);
 
@@ -312,6 +312,9 @@ static void ipoib_ib_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
                        goto drop;
                }
 
+       skb_push(skb, IPOIB_ENCAP_LEN);
+       skb_add_pseudo_hdr(skb);
+
        skb->dev = dev;
        if ((dev->features & NETIF_F_RXCSUM) &&
                        likely(wc->wc_flags & IB_WC_IP_CSUM_OK))