Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122430
b: refs/heads/master
c: d81d228
h: refs/heads/master
v: v3
  • Loading branch information
Martin Willi authored and David S. Miller committed Dec 3, 2008
1 parent a367939 commit d6c4a19
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 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: 29fa0b301bc823016d1a3bed41c36a8977ef9947
refs/heads/master: d81d228567f55af517796638075dbbce9b40d7af
26 changes: 11 additions & 15 deletions trunk/net/xfrm/xfrm_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -2022,31 +2022,27 @@ int xfrm_init_state(struct xfrm_state *x)
x->inner_mode = inner_mode;
} else {
struct xfrm_mode *inner_mode_iaf;
int iafamily = AF_INET;

inner_mode = xfrm_get_mode(x->props.mode, AF_INET);
inner_mode = xfrm_get_mode(x->props.mode, x->props.family);
if (inner_mode == NULL)
goto error;

if (!(inner_mode->flags & XFRM_MODE_FLAG_TUNNEL)) {
xfrm_put_mode(inner_mode);
goto error;
}
x->inner_mode = inner_mode;

inner_mode_iaf = xfrm_get_mode(x->props.mode, AF_INET6);
if (inner_mode_iaf == NULL)
goto error;
if (x->props.family == AF_INET)
iafamily = AF_INET6;

if (!(inner_mode_iaf->flags & XFRM_MODE_FLAG_TUNNEL)) {
xfrm_put_mode(inner_mode_iaf);
goto error;
}

if (x->props.family == AF_INET) {
x->inner_mode = inner_mode;
x->inner_mode_iaf = inner_mode_iaf;
} else {
x->inner_mode = inner_mode_iaf;
x->inner_mode_iaf = inner_mode;
inner_mode_iaf = xfrm_get_mode(x->props.mode, iafamily);
if (inner_mode_iaf) {
if (inner_mode_iaf->flags & XFRM_MODE_FLAG_TUNNEL)
x->inner_mode_iaf = inner_mode_iaf;
else
xfrm_put_mode(inner_mode_iaf);
}
}

Expand Down

0 comments on commit d6c4a19

Please sign in to comment.