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
7aee11a7
Commit
7aee11a7
authored
Jun 30, 2007
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean-up request handling code.
parent
7107cd5d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
message.c
message.c
+5
-5
No files found.
message.c
View file @
7aee11a7
...
@@ -102,13 +102,15 @@ parse_packet(const unsigned char *from, struct network *net,
...
@@ -102,13 +102,15 @@ parse_packet(const unsigned char *from, struct network *net,
continue
;
continue
;
net
->
activity_time
=
now
.
tv_sec
;
net
->
activity_time
=
now
.
tv_sec
;
if
(
message
[
0
]
==
1
)
{
if
(
message
[
0
]
==
1
)
{
int
hopcount
=
message
[
2
];
int
theirseqno
=
message
[
1
];
debugf
(
"Received request on %s from %s (%s) for %s "
debugf
(
"Received request on %s from %s (%s) for %s "
"(%d hops for seqno %d).
\n
"
,
"(%d hops for seqno %d).
\n
"
,
net
->
ifname
,
net
->
ifname
,
format_address
(
neigh
->
id
),
format_address
(
neigh
->
id
),
format_address
(
from
),
format_address
(
from
),
format_address
(
message
+
4
),
format_address
(
message
+
4
),
message
[
2
],
message
[
1
]
);
hopcount
,
theirseqno
);
if
(
memcmp
(
message
+
4
,
zeroes
,
16
)
==
0
)
{
if
(
memcmp
(
message
+
4
,
zeroes
,
16
)
==
0
)
{
/* If a neighbour is requesting a full route dump from us,
/* If a neighbour is requesting a full route dump from us,
we might as well send its txcost. */
we might as well send its txcost. */
...
@@ -116,7 +118,7 @@ parse_packet(const unsigned char *from, struct network *net,
...
@@ -116,7 +118,7 @@ parse_packet(const unsigned char *from, struct network *net,
send_update
(
NULL
,
neigh
->
network
);
send_update
(
NULL
,
neigh
->
network
);
}
else
if
(
memcmp
(
message
+
4
,
myid
,
16
)
==
0
)
{
}
else
if
(
memcmp
(
message
+
4
,
myid
,
16
)
==
0
)
{
int
new_seqno
;
int
new_seqno
;
if
(
message
[
2
]
>
0
&&
seqno_compare
(
message
[
1
]
,
seqno
)
<=
0
)
if
(
hopcount
>
0
&&
seqno_compare
(
theirseqno
,
seqno
)
<=
0
)
/* Somebody's requesting an old seqno. */
/* Somebody's requesting an old seqno. */
new_seqno
=
0
;
new_seqno
=
0
;
else
else
...
@@ -126,12 +128,10 @@ parse_packet(const unsigned char *from, struct network *net,
...
@@ -126,12 +128,10 @@ parse_packet(const unsigned char *from, struct network *net,
struct
destination
*
dest
;
struct
destination
*
dest
;
dest
=
find_destination
(
message
+
4
,
0
,
0
);
dest
=
find_destination
(
message
+
4
,
0
,
0
);
if
(
dest
)
{
if
(
dest
)
{
if
(
message
[
2
]
==
0
)
{
if
(
hopcount
==
0
)
{
send_update
(
dest
,
neigh
->
network
);
send_update
(
dest
,
neigh
->
network
);
}
else
{
}
else
{
/* Request for a new seqno */
/* Request for a new seqno */
int
hopcount
=
message
[
2
];
int
theirseqno
=
message
[
1
];
struct
route
*
installed
;
struct
route
*
installed
;
installed
=
find_installed_route
(
dest
);
installed
=
find_installed_route
(
dest
);
if
(
installed
&&
installed
->
nexthop
!=
neigh
)
{
if
(
installed
&&
installed
->
nexthop
!=
neigh
)
{
...
...
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