Skip to content

Commit cc3a86c

Browse files
dsaherndavem330
authored andcommitted
ipv6: Change rt6_probe to take a fib6_nh
rt6_probe sends probes for gateways in a nexthop. As such it really depends on a fib6_nh, not a fib entry. Move last_probe to fib6_nh and update rt6_probe to a fib6_nh struct. Signed-off-by: David Ahern <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6e1809a commit cc3a86c

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

include/net/ip6_fib.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ struct rt6_exception {
127127

128128
struct fib6_nh {
129129
struct fib_nh_common nh_common;
130+
131+
#ifdef CONFIG_IPV6_ROUTER_PREF
132+
unsigned long last_probe;
133+
#endif
130134
};
131135

132136
struct fib6_info {
@@ -155,10 +159,6 @@ struct fib6_info {
155159
struct rt6_info * __percpu *rt6i_pcpu;
156160
struct rt6_exception_bucket __rcu *rt6i_exception_bucket;
157161

158-
#ifdef CONFIG_IPV6_ROUTER_PREF
159-
unsigned long last_probe;
160-
#endif
161-
162162
u32 fib6_metric;
163163
u8 fib6_protocol;
164164
u8 fib6_type;

net/ipv6/route.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ static void rt6_probe_deferred(struct work_struct *w)
517517
kfree(work);
518518
}
519519

520-
static void rt6_probe(struct fib6_info *rt)
520+
static void rt6_probe(struct fib6_nh *fib6_nh)
521521
{
522522
struct __rt6_probe_work *work = NULL;
523523
const struct in6_addr *nh_gw;
@@ -533,11 +533,11 @@ static void rt6_probe(struct fib6_info *rt)
533533
* Router Reachability Probe MUST be rate-limited
534534
* to no more than one per minute.
535535
*/
536-
if (!rt || !rt->fib6_nh.fib_nh_gw_family)
536+
if (fib6_nh->fib_nh_gw_family)
537537
return;
538538

539-
nh_gw = &rt->fib6_nh.fib_nh_gw6;
540-
dev = rt->fib6_nh.fib_nh_dev;
539+
nh_gw = &fib6_nh->fib_nh_gw6;
540+
dev = fib6_nh->fib_nh_dev;
541541
rcu_read_lock_bh();
542542
idev = __in6_dev_get(dev);
543543
neigh = __ipv6_neigh_lookup_noref(dev, nh_gw);
@@ -554,13 +554,13 @@ static void rt6_probe(struct fib6_info *rt)
554554
__neigh_set_probe_once(neigh);
555555
}
556556
write_unlock(&neigh->lock);
557-
} else if (time_after(jiffies, rt->last_probe +
557+
} else if (time_after(jiffies, fib6_nh->last_probe +
558558
idev->cnf.rtr_probe_interval)) {
559559
work = kmalloc(sizeof(*work), GFP_ATOMIC);
560560
}
561561

562562
if (work) {
563-
rt->last_probe = jiffies;
563+
fib6_nh->last_probe = jiffies;
564564
INIT_WORK(&work->work, rt6_probe_deferred);
565565
work->target = *nh_gw;
566566
dev_hold(dev);
@@ -572,7 +572,7 @@ static void rt6_probe(struct fib6_info *rt)
572572
rcu_read_unlock_bh();
573573
}
574574
#else
575-
static inline void rt6_probe(struct fib6_info *rt)
575+
static inline void rt6_probe(struct fib6_nh *fib6_nh)
576576
{
577577
}
578578
#endif
@@ -657,7 +657,7 @@ static struct fib6_info *find_match(struct fib6_info *rt, int oif, int strict,
657657
}
658658

659659
if (strict & RT6_LOOKUP_F_REACHABLE)
660-
rt6_probe(rt);
660+
rt6_probe(&rt->fib6_nh);
661661

662662
/* note that m can be RT6_NUD_FAIL_PROBE at this point */
663663
if (m > *mpri) {

0 commit comments

Comments
 (0)