Skip to content

Commit 52e1635

Browse files
yoshfujidavem330
authored andcommitted
[IPV6]: ROUTE: Add router_probe_interval sysctl.
Signed-off-by: YOSHIFUJI Hideaki <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 930d6ff commit 52e1635

File tree

5 files changed

+22
-1
lines changed

5 files changed

+22
-1
lines changed

Documentation/networking/ip-sysctl.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,12 @@ mtu - INTEGER
789789
Default Maximum Transfer Unit
790790
Default: 1280 (IPv6 required minimum)
791791

792+
router_probe_interval - INTEGER
793+
Minimum interval (in seconds) between Router Probing described
794+
in RFC4191.
795+
796+
Default: 60
797+
792798
router_solicitation_delay - INTEGER
793799
Number of seconds to wait after interface is brought up
794800
before sending Router Solicitations.

include/linux/ipv6.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ struct ipv6_devconf {
149149
__s32 accept_ra_pinfo;
150150
#ifdef CONFIG_IPV6_ROUTER_PREF
151151
__s32 accept_ra_rtr_pref;
152+
__s32 rtr_probe_interval;
152153
#endif
153154
void *sysctl;
154155
};
@@ -175,6 +176,7 @@ enum {
175176
DEVCONF_ACCEPT_RA_DEFRTR,
176177
DEVCONF_ACCEPT_RA_PINFO,
177178
DEVCONF_ACCEPT_RA_RTR_PREF,
179+
DEVCONF_RTR_PROBE_INTERVAL,
178180
DEVCONF_MAX
179181
};
180182

include/linux/sysctl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,7 @@ enum {
534534
NET_IPV6_ACCEPT_RA_DEFRTR=18,
535535
NET_IPV6_ACCEPT_RA_PINFO=19,
536536
NET_IPV6_ACCEPT_RA_RTR_PREF=20,
537+
NET_IPV6_RTR_PROBE_INTERVAL=21,
537538
__NET_IPV6_MAX
538539
};
539540

net/ipv6/addrconf.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ struct ipv6_devconf ipv6_devconf = {
169169
.accept_ra_pinfo = 1,
170170
#ifdef CONFIG_IPV6_ROUTER_PREF
171171
.accept_ra_rtr_pref = 1,
172+
.rtr_probe_interval = 60 * HZ,
172173
#endif
173174
};
174175

@@ -195,6 +196,7 @@ static struct ipv6_devconf ipv6_devconf_dflt = {
195196
.accept_ra_pinfo = 1,
196197
#ifdef CONFIG_IPV6_ROUTER_PREF
197198
.accept_ra_rtr_pref = 1,
199+
.rtr_probe_interval = 60 * HZ,
198200
#endif
199201
};
200202

@@ -3130,6 +3132,7 @@ static void inline ipv6_store_devconf(struct ipv6_devconf *cnf,
31303132
array[DEVCONF_ACCEPT_RA_PINFO] = cnf->accept_ra_pinfo;
31313133
#ifdef CONFIG_IPV6_ROUTER_PREF
31323134
array[DEVCONF_ACCEPT_RA_RTR_PREF] = cnf->accept_ra_rtr_pref;
3135+
array[DEVCONF_RTR_PROBE_INTERVAL] = cnf->rtr_probe_interval;
31333136
#endif
31343137
}
31353138

@@ -3608,6 +3611,15 @@ static struct addrconf_sysctl_table
36083611
.mode = 0644,
36093612
.proc_handler = &proc_dointvec,
36103613
},
3614+
{
3615+
.ctl_name = NET_IPV6_RTR_PROBE_INTERVAL,
3616+
.procname = "router_probe_interval",
3617+
.data = &ipv6_devconf.rtr_probe_interval,
3618+
.maxlen = sizeof(int),
3619+
.mode = 0644,
3620+
.proc_handler = &proc_dointvec_jiffies,
3621+
.strategy = &sysctl_jiffies,
3622+
},
36113623
#endif
36123624
{
36133625
.ctl_name = 0, /* sentinel */

net/ipv6/route.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ static void rt6_probe(struct rt6_info *rt)
234234
return;
235235
read_lock_bh(&neigh->lock);
236236
if (!(neigh->nud_state & NUD_VALID) &&
237-
time_after(jiffies, neigh->updated + 60 * HZ)) {
237+
time_after(jiffies, neigh->updated + rt->rt6i_idev->cnf.rtr_probe_interval)) {
238238
struct in6_addr mcaddr;
239239
struct in6_addr *target;
240240

0 commit comments

Comments
 (0)