Skip to content

Commit

Permalink
drivers: net: netdevsim: use skb_sec_path helper
Browse files Browse the repository at this point in the history
... 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>
  • Loading branch information
Florian Westphal authored and David S. Miller committed Dec 19, 2018
1 parent 6362a6a commit 56d1ac3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/net/netdevsim/ipsec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 56d1ac3

Please sign in to comment.