Commit b45714b1 authored by Florian Westphal's avatar Florian Westphal Committed by Steffen Klassert

xfrm: prefer family stored in xfrm_mode struct

Now that we have the family available directly in the
xfrm_mode struct, we can use that and avoid one extra dereference.
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Reviewed-by: default avatarSabrina Dubroca <sd@queasysnail.net>
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
parent b262a695
...@@ -137,7 +137,7 @@ static int vti_rcv_cb(struct sk_buff *skb, int err) ...@@ -137,7 +137,7 @@ static int vti_rcv_cb(struct sk_buff *skb, int err)
} }
} }
family = inner_mode->afinfo->family; family = inner_mode->family;
skb->mark = be32_to_cpu(tunnel->parms.i_key); skb->mark = be32_to_cpu(tunnel->parms.i_key);
ret = xfrm_policy_check(NULL, XFRM_POLICY_IN, skb, family); ret = xfrm_policy_check(NULL, XFRM_POLICY_IN, skb, family);
......
...@@ -372,7 +372,7 @@ static int vti6_rcv_cb(struct sk_buff *skb, int err) ...@@ -372,7 +372,7 @@ static int vti6_rcv_cb(struct sk_buff *skb, int err)
} }
} }
family = inner_mode->afinfo->family; family = inner_mode->family;
skb->mark = be32_to_cpu(t->parms.i_key); skb->mark = be32_to_cpu(t->parms.i_key);
ret = xfrm_policy_check(NULL, XFRM_POLICY_IN, skb, family); ret = xfrm_policy_check(NULL, XFRM_POLICY_IN, skb, family);
......
...@@ -216,7 +216,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type) ...@@ -216,7 +216,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
goto drop; goto drop;
} }
family = x->outer_mode->afinfo->family; family = x->outer_mode->family;
/* An encap_type of -1 indicates async resumption. */ /* An encap_type of -1 indicates async resumption. */
if (encap_type == -1) { if (encap_type == -1) {
...@@ -425,7 +425,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type) ...@@ -425,7 +425,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
* transport mode so the outer address is identical. * transport mode so the outer address is identical.
*/ */
daddr = &x->id.daddr; daddr = &x->id.daddr;
family = x->outer_mode->afinfo->family; family = x->outer_mode->family;
err = xfrm_parse_spi(skb, nexthdr, &spi, &seq); err = xfrm_parse_spi(skb, nexthdr, &spi, &seq);
if (err < 0) { if (err < 0) {
......
...@@ -285,7 +285,7 @@ static int xfrmi_rcv_cb(struct sk_buff *skb, int err) ...@@ -285,7 +285,7 @@ static int xfrmi_rcv_cb(struct sk_buff *skb, int err)
} }
if (!xfrm_policy_check(NULL, XFRM_POLICY_IN, skb, if (!xfrm_policy_check(NULL, XFRM_POLICY_IN, skb,
inner_mode->afinfo->family)) inner_mode->family))
return -EPERM; return -EPERM;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment