Skip to content

Commit 965d130

Browse files
authored
Merge pull request FRRouting#18805 from opensourcerouting/fix/rip_passive_interface_failures_random
ripd, ripngd: Timer values
2 parents 432c15f + e7f28e3 commit 965d130

File tree

17 files changed

+58
-56
lines changed

17 files changed

+58
-56
lines changed

doc/developer/northbound/advanced-topics.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ exactly that (e.g. `Clixon <https://github.com/clicon/clixon>`__).
1717
The problem however is that there isn’t an exact one-to-one mapping
1818
between the existing CLI commands and the corresponding YANG nodes from
1919
the native models. As an example, ripd’s
20-
``timers basic (5-2147483647) (5-2147483647) (5-2147483647)`` command
20+
``timers basic (1-32767) (1-32767) (1-32767)`` command
2121
changes three YANG leaves at the same time. In order to auto-generate
2222
CLI commands and retain their original form, it’s necessary to add
2323
annotations in the YANG modules to specify how the commands should look

doc/developer/northbound/retrofitting-configuration-commands.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ Configuration options are edited individually
743743
Several CLI commands edit multiple configuration options at the same
744744
time. Some examples taken from ripd:
745745

746-
* ``timers basic (5-2147483647) (5-2147483647) (5-2147483647)``
746+
* ``timers basic (1-32767) (1-32767) (1-32767)``
747747
* */frr-ripd:ripd/instance/timers/flush-interval*
748748
* */frr-ripd:ripd/instance/timers/holddown-interval*
749749
* */frr-ripd:ripd/instance/timers/update-interval*
@@ -1169,12 +1169,12 @@ same time.
11691169
11701170
DEFPY (rip_timers,
11711171
rip_timers_cmd,
1172-
"timers basic (5-2147483647)$update (5-2147483647)$timeout (5-2147483647)$garbage",
1172+
"timers basic (1-32767)$update (1-32767)$timeout (1-32767)$garbage",
11731173
"Adjust routing timers\n"
11741174
"Basic routing protocol update timers\n"
11751175
"Routing table update timer value in second. Default is 30.\n"
11761176
"Routing information timeout timer. Default is 180.\n"
1177-
"Garbage collection timer. Default is 120.\n")
1177+
"Garbage collection timer. Default is 240.\n")
11781178
{
11791179
struct cli_config_change changes[] = {
11801180
{
@@ -1543,7 +1543,7 @@ any data (apart from their child nodes, but they have their own
15431543
Example 3
15441544
^^^^^^^^^
15451545

1546-
Command: ``timers basic (5-2147483647) (5-2147483647) (5-2147483647)``
1546+
Command: ``timers basic (1-32767) (1-32767) (1-32767)``
15471547

15481548
YANG representation:
15491549

@@ -1553,27 +1553,27 @@ YANG representation:
15531553
description
15541554
"Settings of basic timers";
15551555
leaf flush-interval {
1556-
type uint32 {
1557-
range "5..2147483647";
1556+
type uint16 {
1557+
range "1..32767";
15581558
}
15591559
units "seconds";
1560-
default "120";
1560+
default "240";
15611561
description
15621562
"Interval before a route is flushed from the routing
15631563
table.";
15641564
}
15651565
leaf holddown-interval {
1566-
type uint32 {
1567-
range "5..2147483647";
1566+
type uint16 {
1567+
range "1..32767";
15681568
}
15691569
units "seconds";
15701570
default "180";
15711571
description
15721572
"Interval before better routes are released.";
15731573
}
15741574
leaf update-interval {
1575-
type uint32 {
1576-
range "5..2147483647";
1575+
type uint16 {
1576+
range "1..32767";
15771577
}
15781578
units "seconds";
15791579
default "30";

doc/developer/northbound/yang-module-translator.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@ deviations. Example:
175175
+--rw default-metric? uint8 <1>
176176
+--rw distance? uint8 <0>
177177
+--rw timers
178-
| +--rw update-interval? uint32 <30>
179-
| +--rw holddown-interval? uint32 <180>
180-
| +--rw flush-interval? uint32 <120>
178+
| +--rw update-interval? uint16 <30>
179+
| +--rw holddown-interval? uint16 <180>
180+
| +--rw flush-interval? uint16 <240>
181181
+--rw interfaces
182182
| +--rw interface* [interface]
183183
| +--rw interface ietf-interfaces:interface-ref

doc/user/ripd.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ for routes redistributed into RIP.
499499
ripd> **show ip rip status**
500500
Routing Protocol is "rip"
501501
Sending updates every 30 seconds with +/-50%, next due in 35 seconds
502-
Timeout after 180 seconds, garbage collect after 120 seconds
502+
Timeout after 180 seconds, garbage collect after 240 seconds
503503
Outgoing update filter list for all interface is not set
504504
Incoming update filter list for all interface is not set
505505
Default redistribution metric is 1

ripd/rip_cli.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -539,12 +539,12 @@ void cli_show_rip_route(struct vty *vty, const struct lyd_node *dnode,
539539
*/
540540
DEFPY_YANG (rip_timers,
541541
rip_timers_cmd,
542-
"timers basic (5-2147483647)$update (5-2147483647)$timeout (5-2147483647)$garbage",
542+
"timers basic (1-32767)$update (1-32767)$timeout (1-32767)$garbage",
543543
"Adjust routing timers\n"
544544
"Basic routing protocol update timers\n"
545545
"Routing table update timer value in second. Default is 30.\n"
546546
"Routing information timeout timer. Default is 180.\n"
547-
"Garbage collection timer. Default is 120.\n")
547+
"Garbage collection timer. Default is 240.\n")
548548
{
549549
nb_cli_enqueue_change(vty, "./update-interval", NB_OP_MODIFY,
550550
update_str);
@@ -558,13 +558,13 @@ DEFPY_YANG (rip_timers,
558558

559559
DEFPY_YANG (no_rip_timers,
560560
no_rip_timers_cmd,
561-
"no timers basic [(5-2147483647) (5-2147483647) (5-2147483647)]",
561+
"no timers basic [(1-32767) (1-32767) (1-32767)]",
562562
NO_STR
563563
"Adjust routing timers\n"
564564
"Basic routing protocol update timers\n"
565565
"Routing table update timer value in second. Default is 30.\n"
566566
"Routing information timeout timer. Default is 180.\n"
567-
"Garbage collection timer. Default is 120.\n")
567+
"Garbage collection timer. Default is 240.\n")
568568
{
569569
nb_cli_enqueue_change(vty, "./update-interval", NB_OP_MODIFY, NULL);
570570
nb_cli_enqueue_change(vty, "./holddown-interval", NB_OP_MODIFY, NULL);

ripd/rip_nb_config.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ int ripd_instance_timers_flush_interval_modify(struct nb_cb_modify_args *args)
858858
return NB_OK;
859859

860860
rip = nb_running_get_entry(args->dnode, NULL, true);
861-
rip->garbage_time = yang_dnode_get_uint32(args->dnode, NULL);
861+
rip->garbage_time = yang_dnode_get_uint16(args->dnode, NULL);
862862

863863
return NB_OK;
864864
}
@@ -875,7 +875,7 @@ int ripd_instance_timers_holddown_interval_modify(
875875
return NB_OK;
876876

877877
rip = nb_running_get_entry(args->dnode, NULL, true);
878-
rip->timeout_time = yang_dnode_get_uint32(args->dnode, NULL);
878+
rip->timeout_time = yang_dnode_get_uint16(args->dnode, NULL);
879879

880880
return NB_OK;
881881
}
@@ -891,7 +891,7 @@ int ripd_instance_timers_update_interval_modify(struct nb_cb_modify_args *args)
891891
return NB_OK;
892892

893893
rip = nb_running_get_entry(args->dnode, NULL, true);
894-
rip->update_time = yang_dnode_get_uint32(args->dnode, NULL);
894+
rip->update_time = yang_dnode_get_uint16(args->dnode, NULL);
895895

896896
return NB_OK;
897897
}

ripd/ripd.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2702,12 +2702,9 @@ struct rip *rip_create(const char *vrf_name, struct vrf *vrf, int socket)
27022702
yang_get_default_uint8("%s/distance/default", RIP_INSTANCE);
27032703
rip->passive_default =
27042704
yang_get_default_bool("%s/passive-default", RIP_INSTANCE);
2705-
rip->garbage_time = yang_get_default_uint32("%s/timers/flush-interval",
2706-
RIP_INSTANCE);
2707-
rip->timeout_time = yang_get_default_uint32(
2708-
"%s/timers/holddown-interval", RIP_INSTANCE);
2709-
rip->update_time = yang_get_default_uint32("%s/timers/update-interval",
2710-
RIP_INSTANCE);
2705+
rip->garbage_time = yang_get_default_uint16("%s/timers/flush-interval", RIP_INSTANCE);
2706+
rip->timeout_time = yang_get_default_uint16("%s/timers/holddown-interval", RIP_INSTANCE);
2707+
rip->update_time = yang_get_default_uint16("%s/timers/update-interval", RIP_INSTANCE);
27112708
rip->version_send =
27122709
yang_get_default_enum("%s/version/send", RIP_INSTANCE);
27132710
rip->version_recv =

ripd/ripd.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ struct rip {
128128
struct event *t_triggered_interval;
129129

130130
/* RIP timer values. */
131-
uint32_t update_time;
132-
uint32_t timeout_time;
133-
uint32_t garbage_time;
131+
uint16_t update_time;
132+
uint16_t timeout_time;
133+
uint16_t garbage_time;
134134

135135
/* RIP default metric. */
136136
uint8_t default_metric;

ripngd/ripngd.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,12 +1863,9 @@ struct ripng *ripng_create(const char *vrf_name, struct vrf *vrf, int socket)
18631863

18641864
/* Default version and timer values. */
18651865
ripng->version = RIPNG_V1;
1866-
ripng->update_time = yang_get_default_uint32(
1867-
"%s/timers/update-interval", RIPNG_INSTANCE);
1868-
ripng->timeout_time = yang_get_default_uint32(
1869-
"%s/timers/holddown-interval", RIPNG_INSTANCE);
1870-
ripng->garbage_time = yang_get_default_uint32(
1871-
"%s/timers/flush-interval", RIPNG_INSTANCE);
1866+
ripng->update_time = yang_get_default_uint16("%s/timers/update-interval", RIPNG_INSTANCE);
1867+
ripng->timeout_time = yang_get_default_uint16("%s/timers/holddown-interval", RIPNG_INSTANCE);
1868+
ripng->garbage_time = yang_get_default_uint16("%s/timers/flush-interval", RIPNG_INSTANCE);
18721869
ripng->default_metric =
18731870
yang_get_default_uint8("%s/default-metric", RIPNG_INSTANCE);
18741871
ripng->ecmp = yang_get_default_uint8("%s/allow-ecmp", RIPNG_INSTANCE);

tests/topotests/all_protocol_startup/r1/rip_status.ref

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Routing Protocol is "rip"
22
Sending updates every 30 seconds with +/-50%, next due in XX seconds
3-
Timeout after 180 seconds, garbage collect after 120 seconds
3+
Timeout after 180 seconds, garbage collect after 240 seconds
44
Outgoing update filter list for all interface is not set
55
Incoming update filter list for all interface is not set
66
Default redistribution metric is 1

tests/topotests/all_protocol_startup/r1/ripng_status.ref

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
Routing Protocol is "RIPng"
22
Sending updates every 30 seconds with +/-50%, next due in XX seconds
3-
Timeout after 180 seconds, garbage collect after 120 seconds
3+
Timeout after 180 seconds, garbage collect after 240 seconds
44
Outgoing update filter list for all interface is not set
55
Incoming update filter list for all interface is not set
66
Default redistribution metric is 1
77
Redistributing:
8-
Default version control: send version 1, receive version 1
8+
Default version control: send version 1, receive version 1
99
Interface Send Recv
10-
r1-eth2 1 1
10+
r1-eth2 1 1
1111
Routing for Networks:
1212
fc00:0:0:2::/64
1313
Routing Information Sources:

tests/topotests/all_protocol_startup/test_all_protocol_startup.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,8 @@ def test_rip_status():
711711
# Read expected result from file
712712
with open(refTableFile) as file:
713713
expected = file.read().rstrip()
714+
# Drop trailing whitespaces for each line
715+
expected = "\n".join(line.rstrip() for line in expected.splitlines())
714716
# Fix newlines (make them all the same)
715717
expected = ("\n".join(expected.splitlines()) + "\n").splitlines(1)
716718

@@ -724,6 +726,8 @@ def test_rip_status():
724726
actual = re.sub(r"in [0-9]+ seconds", "in XX seconds", actual)
725727
# Drop time in last update
726728
actual = re.sub(r" [0-2][0-9]:[0-5][0-9]:[0-5][0-9]", " XX:XX:XX", actual)
729+
# Drop trailing whitespaces for each line
730+
actual = "\n".join(line.rstrip() for line in actual.splitlines())
727731
# Fix newlines (make them all the same)
728732
actual = ("\n".join(actual.splitlines()) + "\n").splitlines(1)
729733

@@ -773,6 +777,8 @@ def test_ripng_status():
773777
# Read expected result from file
774778
with open(refTableFile) as file:
775779
expected = file.read().rstrip()
780+
# Drop trailing whitespaces for each line
781+
expected = "\n".join(line.rstrip() for line in expected.splitlines())
776782
# Fix newlines (make them all the same)
777783
expected = ("\n".join(expected.splitlines()) + "\n").splitlines(1)
778784

@@ -788,6 +794,8 @@ def test_ripng_status():
788794
actual = re.sub(r"in [0-9]+ seconds", "in XX seconds", actual)
789795
# Drop time in last update
790796
actual = re.sub(r" [0-2][0-9]:[0-5][0-9]:[0-5][0-9]", " XX:XX:XX", actual)
797+
# Drop trailing whitespaces for each line
798+
actual = "\n".join(line.rstrip() for line in actual.splitlines())
791799
# Fix newlines (make them all the same)
792800
actual = ("\n".join(actual.splitlines()) + "\n").splitlines(1)
793801

tests/topotests/rip_passive_interface/r1/frr.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ int r1-eth0
77
router rip
88
allow-ecmp
99
network 192.168.1.0/24
10-
timers basic 5 15 10
10+
timers basic 1 10 15
1111
exit

tests/topotests/rip_passive_interface/r2/frr.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ router rip
1212
network 192.168.1.0/24
1313
network 10.10.10.1/32
1414
network 0.0.10.1/32
15-
timers basic 5 15 10
15+
timers basic 1 10 15
1616
exit
1717

tests/topotests/rip_passive_interface/r3/frr.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ router rip
1212
network 192.168.1.0/24
1313
network 10.10.10.1/32
1414
network 0.0.10.1/32
15-
timers basic 5 15 10
15+
timers basic 1 10 15
1616
exit
1717

yang/frr-ripd.yang

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -306,27 +306,27 @@ module frr-ripd {
306306
description
307307
"Settings of basic timers";
308308
leaf flush-interval {
309-
type uint32 {
310-
range "5..2147483647";
309+
type uint16 {
310+
range "1..32767";
311311
}
312312
units "seconds";
313-
default "120";
313+
default "240";
314314
description
315315
"Interval before a route is flushed from the routing
316316
table.";
317317
}
318318
leaf holddown-interval {
319-
type uint32 {
320-
range "5..2147483647";
319+
type uint16 {
320+
range "1..32767";
321321
}
322322
units "seconds";
323323
default "180";
324324
description
325325
"Interval before better routes are released.";
326326
}
327327
leaf update-interval {
328-
type uint32 {
329-
range "5..2147483647";
328+
type uint16 {
329+
range "1..32767";
330330
}
331331
units "seconds";
332332
default "30";

yang/frr-ripngd.yang

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,17 +225,17 @@ module frr-ripngd {
225225
"Settings of basic timers";
226226
leaf flush-interval {
227227
type uint16 {
228-
range "1..65535";
228+
range "1..32767";
229229
}
230230
units "seconds";
231-
default "120";
231+
default "240";
232232
description
233233
"Interval before a route is flushed from the routing
234234
table.";
235235
}
236236
leaf holddown-interval {
237237
type uint16 {
238-
range "1..65535";
238+
range "1..32767";
239239
}
240240
units "seconds";
241241
default "180";
@@ -244,7 +244,7 @@ module frr-ripngd {
244244
}
245245
leaf update-interval {
246246
type uint16 {
247-
range "1..65535";
247+
range "1..32767";
248248
}
249249
units "seconds";
250250
default "30";

0 commit comments

Comments
 (0)