Commit 20408758 authored by David S. Miller's avatar David S. Miller

Merge bk://bk.skbuff.net:20611/linux-2.6-inet6

into nuts.davemloft.net:/disk1/BK/net-2.6
parents bd24a6bd 6e382114
......@@ -903,6 +903,9 @@ static void ndisc_recv_na(struct sk_buff *skb)
if (neigh) {
u8 old_flags = neigh->flags;
if (neigh->nud_state & NUD_FAILED)
goto out;
neigh_update(neigh, lladdr,
msg->icmph.icmp6_solicited ? NUD_REACHABLE : NUD_STALE,
NEIGH_UPDATE_F_WEAK_OVERRIDE|
......@@ -920,6 +923,7 @@ static void ndisc_recv_na(struct sk_buff *skb)
ip6_del_rt(rt, NULL, NULL);
}
out:
neigh_release(neigh);
}
}
......
......@@ -167,6 +167,12 @@ static void ip6_dst_ifdown(struct dst_entry *dst, int how)
}
}
static __inline__ int rt6_check_expired(const struct rt6_info *rt)
{
return (rt->rt6i_flags & RTF_EXPIRES &&
time_after(jiffies, rt->rt6i_expires));
}
/*
* Route lookup. Any rt6_lock is implied.
*/
......@@ -237,8 +243,7 @@ static struct rt6_info *rt6_best_dflt(struct rt6_info *rt, int oif)
sprt->rt6i_dev->ifindex == oif))
m += 8;
if ((sprt->rt6i_flags & RTF_EXPIRES) &&
time_after(jiffies, sprt->rt6i_expires))
if (rt6_check_expired(sprt))
continue;
if (sprt == rt6_dflt_pointer)
......@@ -296,7 +301,8 @@ static struct rt6_info *rt6_best_dflt(struct rt6_info *rt, int oif)
for (sprt = rt6_dflt_pointer->u.next;
sprt; sprt = sprt->u.next) {
if (sprt->u.dst.obsolete <= 0 &&
sprt->u.dst.error == 0) {
sprt->u.dst.error == 0 &&
!rt6_check_expired(sprt)) {
match = sprt;
break;
}
......@@ -305,7 +311,8 @@ static struct rt6_info *rt6_best_dflt(struct rt6_info *rt, int oif)
!match && sprt;
sprt = sprt->u.next) {
if (sprt->u.dst.obsolete <= 0 &&
sprt->u.dst.error == 0) {
sprt->u.dst.error == 0 &&
!rt6_check_expired(sprt)) {
match = sprt;
break;
}
......@@ -331,7 +338,8 @@ static struct rt6_info *rt6_best_dflt(struct rt6_info *rt, int oif)
*/
for (sprt = ip6_routing_table.leaf;
sprt; sprt = sprt->u.next) {
if ((sprt->rt6i_flags & RTF_DEFAULT) &&
if (!rt6_check_expired(sprt) &&
(sprt->rt6i_flags & RTF_DEFAULT) &&
(!oif ||
(sprt->rt6i_dev &&
sprt->rt6i_dev->ifindex == oif))) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment