Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323071
b: refs/heads/master
c: 6f3118b
h: refs/heads/master
i:
  323069: 5eedf13
  323067: abe6dde
  323063: 78e1c59
  323055: 64d7063
  323039: 0fe58be
  323007: b2f0c02
  322943: 2fd8459
  322815: 377639e
  322559: 0be7cf4
v: v3
  • Loading branch information
Nicolas Dichtel authored and David S. Miller committed Sep 18, 2012
1 parent c4bc06c commit a69bee5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 30 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: ee8372dd1989287c5eedb69d44bac43f69e496f1
refs/heads/master: 6f3118b571b8a4c06c7985dc3172c3526cb86253
5 changes: 2 additions & 3 deletions trunk/include/net/ip6_fib.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,8 @@ struct rt6_info {
struct inet6_dev *rt6i_idev;
unsigned long _rt6i_peer;

#ifdef CONFIG_XFRM
u32 rt6i_flow_cache_genid;
#endif
u32 rt6i_genid;

/* more non-fragment space at head required */
unsigned short rt6i_nfheader_len;

Expand Down
23 changes: 1 addition & 22 deletions trunk/net/ipv6/inet6_connection_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,33 +175,12 @@ void __inet6_csk_dst_store(struct sock *sk, struct dst_entry *dst,
const struct in6_addr *saddr)
{
__ip6_dst_store(sk, dst, daddr, saddr);

#ifdef CONFIG_XFRM
{
struct rt6_info *rt = (struct rt6_info *)dst;
rt->rt6i_flow_cache_genid = atomic_read(&flow_cache_genid);
}
#endif
}

static inline
struct dst_entry *__inet6_csk_dst_check(struct sock *sk, u32 cookie)
{
struct dst_entry *dst;

dst = __sk_dst_check(sk, cookie);

#ifdef CONFIG_XFRM
if (dst) {
struct rt6_info *rt = (struct rt6_info *)dst;
if (rt->rt6i_flow_cache_genid != atomic_read(&flow_cache_genid)) {
__sk_dst_reset(sk);
dst = NULL;
}
}
#endif

return dst;
return __sk_dst_check(sk, cookie);
}

static struct dst_entry *inet6_csk_route_socket(struct sock *sk,
Expand Down
13 changes: 9 additions & 4 deletions trunk/net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,14 @@ static inline struct rt6_info *ip6_dst_alloc(struct net *net,
struct fib6_table *table)
{
struct rt6_info *rt = dst_alloc(&net->ipv6.ip6_dst_ops, dev,
0, DST_OBSOLETE_NONE, flags);
0, DST_OBSOLETE_FORCE_CHK, flags);

if (rt) {
struct dst_entry *dst = &rt->dst;

memset(dst + 1, 0, sizeof(*rt) - sizeof(*dst));
rt6_init_peer(rt, table ? &table->tb6_peers : net->ipv6.peers);
rt->rt6i_genid = rt_genid(net);
}
return rt;
}
Expand Down Expand Up @@ -1031,6 +1032,13 @@ static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie)

rt = (struct rt6_info *) dst;

/* All IPV6 dsts are created with ->obsolete set to the value
* DST_OBSOLETE_FORCE_CHK which forces validation calls down
* into this function always.
*/
if (rt->rt6i_genid != rt_genid(dev_net(rt->dst.dev)))
return NULL;

if (rt->rt6i_node && (rt->rt6i_node->fn_sernum == cookie)) {
if (rt->rt6i_peer_genid != rt6_peer_genid()) {
if (!rt6_has_peer(rt))
Expand Down Expand Up @@ -1397,8 +1405,6 @@ int ip6_route_add(struct fib6_config *cfg)
goto out;
}

rt->dst.obsolete = -1;

if (cfg->fc_flags & RTF_EXPIRES)
rt6_set_expires(rt, jiffies +
clock_t_to_jiffies(cfg->fc_expires));
Expand Down Expand Up @@ -2080,7 +2086,6 @@ struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev,
rt->dst.input = ip6_input;
rt->dst.output = ip6_output;
rt->rt6i_idev = idev;
rt->dst.obsolete = -1;

rt->rt6i_flags = RTF_UP | RTF_NONEXTHOP;
if (anycast)
Expand Down

0 comments on commit a69bee5

Please sign in to comment.