Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
02efbadc
Commit
02efbadc
authored
10 years ago
by
Lotte Steenbrink
Browse files
Options
Downloads
Patches
Plain Diff
aodvv2: fix check for redundant RREQ
parent
86d44970
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sys/net/routing/aodvv2/utils.c
+3
-4
3 additions, 4 deletions
sys/net/routing/aodvv2/utils.c
sys/net/routing/aodvv2/utils.h
+1
-0
1 addition, 0 deletions
sys/net/routing/aodvv2/utils.h
with
4 additions
and
4 deletions
sys/net/routing/aodvv2/utils.c
+
3
−
4
View file @
02efbadc
...
...
@@ -117,7 +117,7 @@ bool rreqtable_is_redundant(struct aodvv2_packet_data *packet_data)
{
struct
aodvv2_rreq_entry
*
comparable_rreq
;
timex_t
now
;
bool
result
;
bool
result
=
false
;
mutex_lock
(
&
rreqt_mutex
);
comparable_rreq
=
_get_comparable_rreq
(
packet_data
);
...
...
@@ -125,7 +125,6 @@ bool rreqtable_is_redundant(struct aodvv2_packet_data *packet_data)
/* if there is no comparable rreq stored, add one and return false */
if
(
comparable_rreq
==
NULL
)
{
_add_rreq
(
packet_data
);
result
=
false
;
}
else
{
int
seqnum_comparison
=
seqnum_cmp
(
packet_data
->
origNode
.
seqnum
,
comparable_rreq
->
seqnum
);
...
...
@@ -140,8 +139,9 @@ bool rreqtable_is_redundant(struct aodvv2_packet_data *packet_data)
}
if
(
seqnum_comparison
==
1
)
{
/* Update RREQ table entry with new seqnum value */
/* Update RREQ table entry with new seqnum
and metric
value */
comparable_rreq
->
seqnum
=
packet_data
->
origNode
.
seqnum
;
comparable_rreq
->
metric
=
packet_data
->
origNode
.
metric
;
}
/*
...
...
@@ -159,7 +159,6 @@ bool rreqtable_is_redundant(struct aodvv2_packet_data *packet_data)
/* Since we've changed RREQ info, update the timestamp */
vtimer_now
(
&
now
);
comparable_rreq
->
timestamp
=
now
;
result
=
true
;
}
mutex_unlock
(
&
rreqt_mutex
);
...
...
This diff is collapsed.
Click to expand it.
sys/net/routing/aodvv2/utils.h
+
1
−
0
View file @
02efbadc
...
...
@@ -91,6 +91,7 @@ void rreqtable_init(void);
* Check if a RREQ is redundant, i.e. was received from another node already.
* Behaves as described in Sections 5.7. and 7.6.
* @param packet_data data of the RREQ in question
* @return true if packet_data is redundant, false otherwise.
*/
bool
rreqtable_is_redundant
(
struct
aodvv2_packet_data
*
packet_data
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment