Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91939
b: refs/heads/master
c: c5d18e9
h: refs/heads/master
i:
  91937: 1019615
  91935: b17d0c8
v: v3
  • Loading branch information
Herbert Xu authored and David S. Miller committed Apr 22, 2008
1 parent 4861716 commit d8d1687
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7c3f944e29c02d71e13442e977cf4cec19c39e98
refs/heads/master: c5d18e984a313adf5a1a4ae69e0b1d93cf410229
3 changes: 3 additions & 0 deletions trunk/include/net/xfrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,9 @@ struct xfrm_tmpl
/* May skip this transfomration if no SA is found */
__u8 optional;

/* Skip aalgos/ealgos/calgos checks. */
__u8 allalgs;

/* Bit mask of algos allowed for acquisition */
__u32 aalgos;
__u32 ealgos;
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/key/af_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -1907,7 +1907,7 @@ parse_ipsecrequest(struct xfrm_policy *xp, struct sadb_x_ipsecrequest *rq)
t->encap_family = xp->family;

/* No way to set this via kame pfkey */
t->aalgos = t->ealgos = t->calgos = ~0;
t->allalgs = 1;
xp->xfrm_nr++;
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/xfrm/xfrm_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1819,7 +1819,7 @@ xfrm_state_ok(struct xfrm_tmpl *tmpl, struct xfrm_state *x,
(x->id.spi == tmpl->id.spi || !tmpl->id.spi) &&
(x->props.reqid == tmpl->reqid || !tmpl->reqid) &&
x->props.mode == tmpl->mode &&
((tmpl->aalgos & (1<<x->props.aalgo)) ||
(tmpl->allalgs || (tmpl->aalgos & (1<<x->props.aalgo)) ||
!(xfrm_id_proto_match(tmpl->id.proto, IPSEC_PROTO_ANY))) &&
!(x->props.mode != XFRM_MODE_TRANSPORT &&
xfrm_state_addr_cmp(tmpl, x, family));
Expand Down
2 changes: 2 additions & 0 deletions trunk/net/xfrm/xfrm_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,8 @@ static void copy_templates(struct xfrm_policy *xp, struct xfrm_user_tmpl *ut,
t->aalgos = ut->aalgos;
t->ealgos = ut->ealgos;
t->calgos = ut->calgos;
/* If all masks are ~0, then we allow all algorithms. */
t->allalgs = !~(t->aalgos & t->ealgos & t->calgos);
t->encap_family = ut->family;
}
}
Expand Down

0 comments on commit d8d1687

Please sign in to comment.