mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
net: Put flowi_* prefix on AF independent members of struct flowi
I intend to turn struct flowi into a union of AF specific flowi structs. There will be a common structure that each variant includes first, much like struct sock_common. This is the first step to move in that direction. Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
ca116922af
commit
1d28f42c1b
56 changed files with 365 additions and 351 deletions
|
|
@ -63,8 +63,8 @@ __xfrm4_selector_match(const struct xfrm_selector *sel, const struct flowi *fl)
|
|||
addr_match(&fl->fl4_src, &sel->saddr, sel->prefixlen_s) &&
|
||||
!((xfrm_flowi_dport(fl) ^ sel->dport) & sel->dport_mask) &&
|
||||
!((xfrm_flowi_sport(fl) ^ sel->sport) & sel->sport_mask) &&
|
||||
(fl->proto == sel->proto || !sel->proto) &&
|
||||
(fl->oif == sel->ifindex || !sel->ifindex);
|
||||
(fl->flowi_proto == sel->proto || !sel->proto) &&
|
||||
(fl->flowi_oif == sel->ifindex || !sel->ifindex);
|
||||
}
|
||||
|
||||
static inline int
|
||||
|
|
@ -74,8 +74,8 @@ __xfrm6_selector_match(const struct xfrm_selector *sel, const struct flowi *fl)
|
|||
addr_match(&fl->fl6_src, &sel->saddr, sel->prefixlen_s) &&
|
||||
!((xfrm_flowi_dport(fl) ^ sel->dport) & sel->dport_mask) &&
|
||||
!((xfrm_flowi_sport(fl) ^ sel->sport) & sel->sport_mask) &&
|
||||
(fl->proto == sel->proto || !sel->proto) &&
|
||||
(fl->oif == sel->ifindex || !sel->ifindex);
|
||||
(fl->flowi_proto == sel->proto || !sel->proto) &&
|
||||
(fl->flowi_oif == sel->ifindex || !sel->ifindex);
|
||||
}
|
||||
|
||||
int xfrm_selector_match(const struct xfrm_selector *sel, const struct flowi *fl,
|
||||
|
|
@ -876,13 +876,13 @@ static int xfrm_policy_match(const struct xfrm_policy *pol,
|
|||
int match, ret = -ESRCH;
|
||||
|
||||
if (pol->family != family ||
|
||||
(fl->mark & pol->mark.m) != pol->mark.v ||
|
||||
(fl->flowi_mark & pol->mark.m) != pol->mark.v ||
|
||||
pol->type != type)
|
||||
return ret;
|
||||
|
||||
match = xfrm_selector_match(sel, fl, family);
|
||||
if (match)
|
||||
ret = security_xfrm_policy_lookup(pol->security, fl->secid,
|
||||
ret = security_xfrm_policy_lookup(pol->security, fl->flowi_secid,
|
||||
dir);
|
||||
|
||||
return ret;
|
||||
|
|
@ -1012,7 +1012,7 @@ static struct xfrm_policy *xfrm_sk_policy_lookup(struct sock *sk, int dir,
|
|||
goto out;
|
||||
}
|
||||
err = security_xfrm_policy_lookup(pol->security,
|
||||
fl->secid,
|
||||
fl->flowi_secid,
|
||||
policy_to_flow_dir(dir));
|
||||
if (!err)
|
||||
xfrm_pol_hold(pol);
|
||||
|
|
@ -1848,7 +1848,7 @@ restart:
|
|||
|
||||
return make_blackhole(net, family, dst_orig);
|
||||
}
|
||||
if (fl->flags & FLOWI_FLAG_CAN_SLEEP) {
|
||||
if (fl->flowi_flags & FLOWI_FLAG_CAN_SLEEP) {
|
||||
DECLARE_WAITQUEUE(wait, current);
|
||||
|
||||
add_wait_queue(&net->xfrm.km_waitq, &wait);
|
||||
|
|
@ -1990,7 +1990,7 @@ int __xfrm_decode_session(struct sk_buff *skb, struct flowi *fl,
|
|||
return -EAFNOSUPPORT;
|
||||
|
||||
afinfo->decode_session(skb, fl, reverse);
|
||||
err = security_xfrm_decode_session(skb, &fl->secid);
|
||||
err = security_xfrm_decode_session(skb, &fl->flowi_secid);
|
||||
xfrm_policy_put_afinfo(afinfo);
|
||||
return err;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -859,7 +859,7 @@ found:
|
|||
xfrm_init_tempstate(x, fl, tmpl, daddr, saddr, family);
|
||||
memcpy(&x->mark, &pol->mark, sizeof(x->mark));
|
||||
|
||||
error = security_xfrm_state_alloc_acquire(x, pol->security, fl->secid);
|
||||
error = security_xfrm_state_alloc_acquire(x, pol->security, fl->flowi_secid);
|
||||
if (error) {
|
||||
x->km.state = XFRM_STATE_DEAD;
|
||||
to_put = x;
|
||||
|
|
|
|||
Loading…
Reference in a new issue