Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
babeld
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
babeld
Commits
cab2e8ca
Commit
cab2e8ca
authored
Jun 28, 2007
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add explicit seqno argument to send_request, use it when forwarding.
parent
3bf64b13
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
14 deletions
+22
-14
babel.c
babel.c
+3
-3
message.c
message.c
+14
-6
message.h
message.h
+2
-2
neighbour.c
neighbour.c
+1
-1
route.c
route.c
+2
-2
No files found.
babel.c
View file @
cab2e8ca
...
...
@@ -369,14 +369,14 @@ main(int argc, char **argv)
/* Make some noise so others notice us */
for
(
i
=
0
;
i
<
numnets
;
i
++
)
{
send_hello
(
&
nets
[
i
]);
send_request
(
&
nets
[
i
],
NULL
,
0
);
send_request
(
&
nets
[
i
],
NULL
,
0
,
-
1
);
}
for
(
i
=
0
;
i
<
numnets
;
i
++
)
{
usleep
(
50000
+
random
()
%
100000
);
flushbuf
(
&
nets
[
i
]);
send_hello
(
&
nets
[
i
]);
send_self_update
(
&
nets
[
i
],
0
);
send_request
(
&
nets
[
i
],
NULL
,
0
);
send_request
(
&
nets
[
i
],
NULL
,
0
,
-
1
);
}
debugf
(
"Entering main loop.
\n
"
);
...
...
@@ -742,7 +742,7 @@ expire_routes(void)
if
(
route
->
installed
&&
route
->
refmetric
<
INFINITY
)
{
if
(
route
->
time
<
now
.
tv_sec
-
MAX
(
5
,
route_timeout_delay
-
25
))
send_unicast_request
(
route
->
nexthop
,
route
->
dest
,
0
);
send_unicast_request
(
route
->
nexthop
,
route
->
dest
,
0
,
-
1
);
}
i
++
;
}
...
...
message.c
View file @
cab2e8ca
...
...
@@ -141,7 +141,8 @@ parse_packet(const unsigned char *from, struct network *net,
else
if
(
hopcount
>=
2
)
{
send_unicast_request
(
installed
->
nexthop
,
dest
,
hopcount
-
1
);
hopcount
-
1
,
theirseqno
);
/* For now, let's hope the new seqno
arrives before the update is flushed. */
send_update
(
dest
,
neigh
->
network
);
...
...
@@ -324,13 +325,14 @@ send_hello(struct network *net)
}
void
send_request
(
struct
network
*
net
,
struct
destination
*
dest
,
int
hopcount
)
send_request
(
struct
network
*
net
,
struct
destination
*
dest
,
int
hopcount
,
int
seqno
)
{
int
i
;
if
(
net
==
NULL
)
{
for
(
i
=
0
;
i
<
numnets
;
i
++
)
send_request
(
&
nets
[
i
],
dest
,
hopcount
);
send_request
(
&
nets
[
i
],
dest
,
hopcount
,
seqno
);
return
;
}
...
...
@@ -339,6 +341,9 @@ send_request(struct network *net, struct destination *dest, int hopcount)
start_message
(
net
,
20
);
accumulate_byte
(
net
,
1
);
if
(
hopcount
>
0
&&
dest
)
{
if
(
seqno
>=
0
)
accumulate_byte
(
net
,
seqno
);
else
accumulate_byte
(
net
,
dest
->
seqno
);
accumulate_byte
(
net
,
hopcount
);
}
else
{
...
...
@@ -377,7 +382,7 @@ send_unicast_packet(struct neighbour *neigh, unsigned char *buf, int buflen)
void
send_unicast_request
(
struct
neighbour
*
neigh
,
struct
destination
*
dest
,
int
hopcount
)
int
hopcount
,
int
seqno
)
{
unsigned
char
buf
[
20
];
...
...
@@ -388,6 +393,9 @@ send_unicast_request(struct neighbour *neigh, struct destination *dest,
buf
[
0
]
=
1
;
if
(
hopcount
>
0
&&
dest
)
{
if
(
seqno
>=
0
)
buf
[
1
]
=
seqno
;
else
buf
[
1
]
=
dest
->
seqno
;
buf
[
2
]
=
hopcount
;
}
else
{
...
...
message.h
View file @
cab2e8ca
...
...
@@ -40,9 +40,9 @@ void parse_packet(const unsigned char *from, struct network *net,
void
flushbuf
(
struct
network
*
net
);
void
send_hello
(
struct
network
*
net
);
void
send_request
(
struct
network
*
net
,
struct
destination
*
dest
,
int
hopcount
);
int
hopcount
,
int
seqno
);
void
send_unicast_request
(
struct
neighbour
*
neigh
,
struct
destination
*
dest
,
int
hopcount
);
int
hopcount
,
int
seqno
);
void
send_update
(
struct
destination
*
dest
,
struct
network
*
net
);
void
send_self_update
(
struct
network
*
net
,
int
force_seqno
);
void
send_self_retract
(
struct
network
*
net
);
...
...
neighbour.c
View file @
cab2e8ca
...
...
@@ -174,7 +174,7 @@ update_neighbour(struct neighbour *neigh, int hello, int hello_interval)
if
(
dest
)
route
=
find_best_route
(
dest
);
if
(
!
route
||
route
->
nexthop
==
neigh
)
send_unicast_request
(
neigh
,
NULL
,
0
);
send_unicast_request
(
neigh
,
NULL
,
0
,
-
1
);
}
}
...
...
route.c
View file @
cab2e8ca
...
...
@@ -100,7 +100,7 @@ flush_route(struct route *route)
dest
->
seqno
=
(
dest
->
seqno
+
1
)
&
0xFF
;
}
send_update
(
route
->
dest
,
NULL
);
send_request
(
NULL
,
route
->
dest
,
max_hopcount
);
send_request
(
NULL
,
route
->
dest
,
max_hopcount
,
-
1
);
}
}
}
...
...
@@ -431,6 +431,6 @@ send_triggered_update(struct route *route, int oldmetric)
if
(
route
->
metric
-
oldmetric
>=
384
)
{
/* This route's metric has increased a lot -- let's hope we find
something better */
send_request
(
NULL
,
route
->
dest
,
1
);
send_request
(
NULL
,
route
->
dest
,
1
,
-
1
);
}
}
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