Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 34605
b: refs/heads/master
c: 9d4a706
h: refs/heads/master
i:
  34603: c6fb357
v: v3
  • Loading branch information
David S. Miller committed Sep 22, 2006
1 parent d785bff commit 5dd58a1
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f034b5d4efdfe0fb9e2a1ce1d95fa7914f24de49
refs/heads/master: 9d4a706d852411154d0c91b9ffb3bec68b94b25c
3 changes: 3 additions & 0 deletions trunk/include/net/xfrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ struct xfrm_state
struct xfrm_id id;
struct xfrm_selector sel;

u32 genid;

/* Key manger bits */
struct {
u8 state;
Expand Down Expand Up @@ -590,6 +592,7 @@ struct xfrm_dst
struct rt6_info rt6;
} u;
struct dst_entry *route;
u32 genid;
u32 route_mtu_cached;
u32 child_mtu_cached;
u32 route_cookie;
Expand Down
1 change: 1 addition & 0 deletions trunk/net/ipv4/xfrm4_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ __xfrm4_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int

xdst = (struct xfrm_dst *)dst1;
xdst->route = &rt->u.dst;
xdst->genid = xfrm[i]->genid;

dst1->next = dst_prev;
dst_prev = dst1;
Expand Down
1 change: 1 addition & 0 deletions trunk/net/ipv6/xfrm6_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ __xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int

xdst = (struct xfrm_dst *)dst1;
xdst->route = &rt->u.dst;
xdst->genid = xfrm[i]->genid;
if (rt->rt6i_node)
xdst->route_cookie = rt->rt6i_node->fn_sernum;

Expand Down
2 changes: 2 additions & 0 deletions trunk/net/xfrm/xfrm_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1536,6 +1536,8 @@ int xfrm_bundle_ok(struct xfrm_dst *first, struct flowi *fl, int family, int str
return 0;
if (dst->xfrm->km.state != XFRM_STATE_VALID)
return 0;
if (xdst->genid != dst->xfrm->genid)
return 0;

if (strict && fl && dst->xfrm->props.mode != XFRM_MODE_TUNNEL &&
!xfrm_state_addr_flow_check(dst->xfrm, fl, family))
Expand Down
3 changes: 3 additions & 0 deletions trunk/net/xfrm/xfrm_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ static struct hlist_head *xfrm_state_byspi __read_mostly;
static unsigned int xfrm_state_hmask __read_mostly;
static unsigned int xfrm_state_hashmax __read_mostly = 1 * 1024 * 1024;
static unsigned int xfrm_state_num;
static unsigned int xfrm_state_genid;

static inline unsigned int __xfrm4_dst_hash(xfrm_address_t *addr, unsigned int hmask)
{
Expand Down Expand Up @@ -745,6 +746,8 @@ static void __xfrm_state_insert(struct xfrm_state *x)
{
unsigned int h = xfrm_dst_hash(&x->id.daddr, x->props.family);

x->genid = ++xfrm_state_genid;

hlist_add_head(&x->bydst, xfrm_state_bydst+h);
xfrm_state_hold(x);

Expand Down

0 comments on commit 5dd58a1

Please sign in to comment.