Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BIRD Internet Routing Daemon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
labs
BIRD Internet Routing Daemon
Commits
a9c38203
Commit
a9c38203
authored
Feb 24, 2013
by
Ondřej Filip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow 1 sec RIP update.
parent
04ddefb3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
13 deletions
+14
-13
proto/rip/rip.c
proto/rip/rip.c
+13
-13
proto/rip/rip.h
proto/rip/rip.h
+1
-0
No files found.
proto/rip/rip.c
View file @
a9c38203
...
...
@@ -7,14 +7,13 @@
* Can be freely distributed and used under the terms of the GNU GPL.
*
FIXME: IpV6 support: packet size
FIXME: (nonurgent) I
pV
6 support: receive "route using" blocks
FIXME: (nonurgent) I
pV
6 support: generate "nexthop" blocks
FIXME: (nonurgent) I
Pv
6 support: receive "route using" blocks
FIXME: (nonurgent) I
Pv
6 support: generate "nexthop" blocks
next hops are only advisory, and they are pretty ugly in IpV6.
I suggest just forgetting about them.
FIXME: (nonurgent): fold rip_connection into rip_interface?
FIXME: (nonurgent) allow bigger frequencies than 1 regular update in 6 seconds (?)
FIXME: propagation of metric=infinity into main routing table may or may not be good idea.
*/
...
...
@@ -162,7 +161,7 @@ rip_tx( sock *s )
FIB_ITERATE_START
(
&
P
->
rtable
,
&
c
->
iter
,
z
)
{
struct
rip_entry
*
e
=
(
struct
rip_entry
*
)
z
;
if
(
!
rif
->
triggered
||
(
!
(
e
->
updated
<
now
-
5
)))
{
if
(
!
rif
->
triggered
||
(
!
(
e
->
updated
<
now
-
2
)))
{
/* FIXME: Should be probably 1 or some different algorithm */
nullupdate
=
0
;
i
=
rip_tx_prepare
(
p
,
packet
->
block
+
i
,
e
,
rif
,
i
);
if
(
i
>=
maxi
)
{
...
...
@@ -557,17 +556,23 @@ rip_timer(timer *t)
DBG
(
"RIP: Broadcasting routing tables
\n
"
);
{
struct
rip_interface
*
rif
;
if
(
P_CF
->
period
>
2
)
{
/* Bring some randomness into sending times */
if
(
!
(
P
->
tx_count
%
P_CF
->
period
))
P
->
rnd_count
=
random_u32
()
%
2
;
}
else
P
->
rnd_count
=
P
->
tx_count
%
P_CF
->
period
;
WALK_LIST
(
rif
,
P
->
interfaces
)
{
struct
iface
*
iface
=
rif
->
iface
;
if
(
!
iface
)
continue
;
if
(
rif
->
mode
&
IM_QUIET
)
continue
;
if
(
!
(
iface
->
flags
&
IF_UP
))
continue
;
rif
->
triggered
=
P
->
rnd_count
;
rif
->
triggered
=
(
P
->
tx_count
%
6
);
rip_sendto
(
p
,
IPA_NONE
,
0
,
rif
);
}
P
->
tx_count
++
;
P
->
tx_count
++
;
P
->
rnd_count
--
;
}
DBG
(
"RIP: tick tock done
\n
"
);
...
...
@@ -595,14 +600,9 @@ rip_start(struct proto *p)
init_list
(
&
P
->
interfaces
);
P
->
timer
=
tm_new
(
p
->
pool
);
P
->
timer
->
data
=
p
;
P
->
timer
->
randomize
=
2
;
P
->
timer
->
recurrent
=
(
P_CF
->
period
/
6
)
-
1
;
if
(
P_CF
->
period
<
12
)
{
log
(
L_WARN
"Period %d is too low. So I am using 12 which is the lowest possible value."
,
P_CF
->
period
);
P
->
timer
->
recurrent
=
1
;
}
P
->
timer
->
recurrent
=
1
;
P
->
timer
->
hook
=
rip_timer
;
tm_start
(
P
->
timer
,
5
);
tm_start
(
P
->
timer
,
2
);
rif
=
new_iface
(
p
,
NULL
,
0
,
NULL
);
/* Initialize dummy interface */
add_head
(
&
P
->
interfaces
,
NODE
rif
);
CHK_MAGIC
;
...
...
proto/rip/rip.h
View file @
a9c38203
...
...
@@ -162,6 +162,7 @@ struct rip_proto {
int
magic
;
#endif
int
tx_count
;
/* Do one regular update once in a while */
int
rnd_count
;
/* Randomize sending time */
};
#ifdef LOCAL_DEBUG
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment