Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 2308
b: refs/heads/master
c: d094cd8
h: refs/heads/master
v: v3
  • Loading branch information
Herbert Xu authored and David S. Miller committed Jun 20, 2005
1 parent 6db8440 commit eaaba24
Show file tree
Hide file tree
Showing 3 changed files with 20 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: 72cb6962a91f2af9eef69a06198e1949c10259ae
refs/heads/master: d094cd83c06e06e01d8edb540555f3f64e4081c2
1 change: 1 addition & 0 deletions trunk/include/net/xfrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ struct xfrm_state_afinfo {
rwlock_t lock;
struct list_head *state_bydst;
struct list_head *state_byspi;
int (*init_flags)(struct xfrm_state *x);
void (*init_tempsel)(struct xfrm_state *x, struct flowi *fl,
struct xfrm_tmpl *tmpl,
xfrm_address_t *daddr, xfrm_address_t *saddr);
Expand Down
20 changes: 18 additions & 2 deletions trunk/net/xfrm/xfrm_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1058,10 +1058,26 @@ EXPORT_SYMBOL(xfrm_state_mtu);

int xfrm_init_state(struct xfrm_state *x)
{
struct xfrm_state_afinfo *afinfo;
int family = x->props.family;
int err;

err = -ENOENT;
x->type = xfrm_get_type(x->id.proto, x->props.family);
err = -EAFNOSUPPORT;
afinfo = xfrm_state_get_afinfo(family);
if (!afinfo)
goto error;

err = 0;
if (afinfo->init_flags)
err = afinfo->init_flags(x);

xfrm_state_put_afinfo(afinfo);

if (err)
goto error;

err = -EPROTONOSUPPORT;
x->type = xfrm_get_type(x->id.proto, family);
if (x->type == NULL)
goto error;

Expand Down

0 comments on commit eaaba24

Please sign in to comment.