drivers: net: netdevsim: use skb_sec_path helper
authorFlorian Westphal <fw@strlen.de>
Tue, 18 Dec 2018 16:15:23 +0000 (17:15 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Dec 2018 19:21:37 +0000 (11:21 -0800)
... so this won't have to be changed when skb->sp goes away.

v2: no changes, preserve ack.

Acked-by: Shannon Nelson <shannon.lee.nelson@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/netdevsim/ipsec.c

index 2dcf6cc269d0d43f81e433d30b9f16e03a05124a..76e11d889bb6eab360cf629d7945235a07ee23a9 100644 (file)
@@ -227,18 +227,19 @@ static const struct xfrmdev_ops nsim_xfrmdev_ops = {
 
 bool nsim_ipsec_tx(struct netdevsim *ns, struct sk_buff *skb)
 {
+       struct sec_path *sp = skb_sec_path(skb);
        struct nsim_ipsec *ipsec = &ns->ipsec;
        struct xfrm_state *xs;
        struct nsim_sa *tsa;
        u32 sa_idx;
 
        /* do we even need to check this packet? */
-       if (!skb->sp)
+       if (!sp)
                return true;
 
-       if (unlikely(!skb->sp->len)) {
+       if (unlikely(!sp->len)) {
                netdev_err(ns->netdev, "no xfrm state len = %d\n",
-                          skb->sp->len);
+                          sp->len);
                return false;
        }