Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ieee1905
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Automate
Agent sessions
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
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Multi-AP
ieee1905
Commits
bc6c1e37
Commit
bc6c1e37
authored
Jun 11, 2024
by
Anjan Chanda
Browse files
Options
Downloads
Patches
Plain Diff
unlink hlist entries before delete
parent
556c96ec
No related branches found
No related tags found
No related merge requests found
Pipeline
#156059
passed
Jun 11, 2024
Stage: static_code_analysis
Stage: compile_test
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/cmdu_ackq.c
+24
-3
24 additions, 3 deletions
src/cmdu_ackq.c
src/debug.h
+10
-0
10 additions, 0 deletions
src/debug.h
src/neigh.c
+5
-1
5 additions, 1 deletion
src/neigh.c
with
39 additions
and
4 deletions
src/cmdu_ackq.c
+
24
−
3
View file @
bc6c1e37
...
@@ -20,9 +20,20 @@
...
@@ -20,9 +20,20 @@
#include
"cmdu_ackq.h"
#include
"cmdu_ackq.h"
#define err(...) log_stderr(0, __VA_ARGS__)
#define err(...) log_stderr(0, __VA_ARGS__)
#define warn(...) log_stderr(1, __VA_ARGS__)
#define dbg(...) log_stderr(3, __VA_ARGS__)
#define dbg(...) log_stderr(3, __VA_ARGS__)
#define loud(...) log_stderr(5, __VA_ARGS__)
#define loud(...) log_stderr(5, __VA_ARGS__)
#ifndef warn_on
#define warn_on(condition) \
({ \
int __rc = !!(condition); \
if (__rc) \
warn("%s: WARN '%s'\n", __func__, #condition); \
__rc; \
})
#endif
static
int
timeradd_msecs
(
struct
timeval
*
a
,
unsigned
long
msecs
,
static
int
timeradd_msecs
(
struct
timeval
*
a
,
unsigned
long
msecs
,
struct
timeval
*
res
)
struct
timeval
*
res
)
{
{
...
@@ -102,10 +113,12 @@ static void cmdu_ackq_delete_msg(struct cmdu_ackq *st, struct cmdu_ackq_entry *m
...
@@ -102,10 +113,12 @@ static void cmdu_ackq_delete_msg(struct cmdu_ackq *st, struct cmdu_ackq_entry *m
return
;
return
;
if
(
msg
->
cookie
)
{
if
(
msg
->
cookie
)
{
if
(
st
->
delete_cb
)
if
(
st
->
delete_cb
)
{
st
->
delete_cb
(
st
,
msg
);
st
->
delete_cb
(
st
,
msg
);
else
}
else
{
free
(
msg
->
cookie
);
free
(
msg
->
cookie
);
msg
->
cookie
=
NULL
;
}
}
}
free
(
msg
);
free
(
msg
);
...
@@ -241,15 +254,23 @@ void cmdu_ackq_flush(void *cmdu_q)
...
@@ -241,15 +254,23 @@ void cmdu_ackq_flush(void *cmdu_q)
{
{
struct
cmdu_ackq
*
q
=
(
struct
cmdu_ackq
*
)
cmdu_q
;
struct
cmdu_ackq
*
q
=
(
struct
cmdu_ackq
*
)
cmdu_q
;
struct
cmdu_ackq_entry
*
msg
=
NULL
;
struct
cmdu_ackq_entry
*
msg
=
NULL
;
struct
hlist_node
*
tmp
;
int
idx
=
0
;
int
idx
=
0
;
for
(
idx
=
0
;
idx
<
CMDU_BACKLOG_MAX
;
idx
++
)
{
for
(
idx
=
0
;
idx
<
CMDU_BACKLOG_MAX
;
idx
++
)
{
hlist_for_each_entry
(
msg
,
&
q
->
table
[
idx
],
hlist
)
if
(
hlist_empty
(
&
q
->
table
[
idx
]))
continue
;
hlist_for_each_entry_safe
(
msg
,
tmp
,
&
q
->
table
[
idx
],
hlist
)
{
hlist_del
(
&
msg
->
hlist
,
&
q
->
table
[
idx
]);
q
->
pending_cnt
--
;
cmdu_ackq_delete_msg
(
q
,
msg
);
cmdu_ackq_delete_msg
(
q
,
msg
);
}
q
->
table
[
idx
].
first
=
NULL
;
q
->
table
[
idx
].
first
=
NULL
;
}
}
warn_on
(
q
->
pending_cnt
!=
0
);
q
->
pending_cnt
=
0
;
q
->
pending_cnt
=
0
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/debug.h
+
10
−
0
View file @
bc6c1e37
...
@@ -41,6 +41,15 @@ void log_cmdu(uint8_t *buf, size_t len, const char *ifname, bool is_rx);
...
@@ -41,6 +41,15 @@ void log_cmdu(uint8_t *buf, size_t len, const char *ifname, bool is_rx);
#define dbg7(fmt, ...) log_message(7, nocl fmt nocl, ## __VA_ARGS__)
#define dbg7(fmt, ...) log_message(7, nocl fmt nocl, ## __VA_ARGS__)
#define logcmdu(b,l,i,t) log_cmdu(b,l,i,t)
#define logcmdu(b,l,i,t) log_cmdu(b,l,i,t)
#define warn_on(condition) \
({ \
int __rc = !!(condition); \
if (__rc) \
warn("%s: WARN '%s'\n", __func__, #condition); \
__rc; \
})
#else
#else
#define err(...) log_message(0, __VA_ARGS__)
#define err(...) log_message(0, __VA_ARGS__)
...
@@ -54,6 +63,7 @@ void log_cmdu(uint8_t *buf, size_t len, const char *ifname, bool is_rx);
...
@@ -54,6 +63,7 @@ void log_cmdu(uint8_t *buf, size_t len, const char *ifname, bool is_rx);
#define dbg7(fmt, ...) log_message(7, __VA_ARGS__)
#define dbg7(fmt, ...) log_message(7, __VA_ARGS__)
#define logcmdu(b,l,i,t)
#define logcmdu(b,l,i,t)
#define warn_on(condition)
#endif
/* DEBUG_COLOR */
#endif
/* DEBUG_COLOR */
#endif
/* DEBUG_H */
#endif
/* DEBUG_H */
This diff is collapsed.
Click to expand it.
src/neigh.c
+
5
−
1
View file @
bc6c1e37
...
@@ -321,12 +321,16 @@ void neigh_queue_flush(void *nq)
...
@@ -321,12 +321,16 @@ void neigh_queue_flush(void *nq)
if
(
hlist_empty
(
&
q
->
table
[
idx
]))
if
(
hlist_empty
(
&
q
->
table
[
idx
]))
continue
;
continue
;
hlist_for_each_entry_safe
(
e
,
tmp
,
&
q
->
table
[
idx
],
hlist
)
hlist_for_each_entry_safe
(
e
,
tmp
,
&
q
->
table
[
idx
],
hlist
)
{
hlist_del
(
&
e
->
hlist
,
&
q
->
table
[
idx
]);
q
->
pending_cnt
--
;
neigh_entry_delete
(
e
);
neigh_entry_delete
(
e
);
}
q
->
table
[
idx
].
first
=
NULL
;
q
->
table
[
idx
].
first
=
NULL
;
}
}
warn_on
(
q
->
pending_cnt
!=
0
);
q
->
pending_cnt
=
0
;
q
->
pending_cnt
=
0
;
}
}
...
...
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
sign in
to comment