Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
map-controller
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
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Multi-AP
map-controller
Commits
57b845da
Commit
57b845da
authored
3 years ago
by
Stanislaw Gruszka
Committed by
Jakob Olsson
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
free memory at exit
parent
ba2d3102
No related branches found
No related tags found
1 merge request
!103
free memory at exit
Pipeline
#46687
passed
3 years ago
Stage: static_code_analysis
Stage: compile_test
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/cntlr.c
+52
-8
52 additions, 8 deletions
src/cntlr.c
src/cntlr.h
+0
-1
0 additions, 1 deletion
src/cntlr.h
src/main.c
+3
-4
3 additions, 4 deletions
src/main.c
with
55 additions
and
13 deletions
src/cntlr.c
+
52
−
8
View file @
57b845da
...
...
@@ -1337,6 +1337,51 @@ struct node *alloc_node_init(struct controller *c, uint8_t *hwaddr)
return
n
;
}
#if 0
void node_clean_stalist(struct node *n)
{
struct radio_policy *r = NULL, *tmp;
list_for_each_entry_safe(p, tmp, &n->stalist, list) {
list_del(&->list);
free(p);
}
return 0;
}
#endif
static
void
radio_clean_iflist
(
struct
netif_radio
*
r
)
{
struct
netif_iface
*
ni
=
NULL
,
*
tmp
;
list_for_each_entry_safe
(
ni
,
tmp
,
&
r
->
iflist
,
list
)
{
list_del
(
&
ni
->
list
);
free
(
ni
);
}
}
static
void
node_clean_radiolist
(
struct
node
*
n
)
{
struct
netif_radio
*
r
=
NULL
,
*
tmp
;
list_for_each_entry_safe
(
r
,
tmp
,
&
n
->
radiolist
,
list
)
{
list_del
(
&
r
->
list
);
radio_clean_iflist
(
r
);
free
(
r
);
}
}
static
void
cntlr_clean_nodelist
(
struct
controller
*
c
)
{
struct
node
*
n
=
NULL
,
*
tmp
;
list_for_each_entry_safe
(
n
,
tmp
,
&
c
->
nodelist
,
list
)
{
list_del
(
&
n
->
list
);
node_clean_radiolist
(
n
);
free
(
n
);
}
}
void
free_bcn_metrics
(
struct
controller
*
c
,
struct
sta
*
s
)
{
struct
bcn_metrics
*
b
=
NULL
,
*
tmp
;
...
...
@@ -2361,7 +2406,7 @@ static void cntlr_event_handler(struct ubus_context *ctx,
}
int
start
_controller
(
void
)
void
run
_controller
(
void
)
{
struct
controller
*
c
;
struct
ubus_context
*
ctx
;
...
...
@@ -2376,7 +2421,7 @@ int start_controller(void)
c
=
calloc
(
1
,
sizeof
(
struct
controller
));
if
(
!
c
)
return
-
1
;
return
;
cntlr_dbg
(
"Starting wifi_cntlr... (&cntlr = %p)
\n
"
,
c
);
...
...
@@ -2385,7 +2430,7 @@ int start_controller(void)
if
(
!
ctx
)
{
err
(
"Failed to connect to ubus
\n
"
);
free
(
c
);
return
-
1
;
return
;
}
c
->
ubus_ctx
=
ctx
;
INIT_LIST_HEAD
(
&
c
->
stalist
);
...
...
@@ -2442,16 +2487,15 @@ int start_controller(void)
controller_subscribe_for_cmdus
(
c
);
uloop_run
();
out_exit:
ubus_unregister_event_handler
(
ctx
,
&
c
->
evh
);
map_unsubscribe
(
ctx
,
c
->
subscriber
);
cntlr_remove_object
(
c
);
cmdu_ackq_free
(
&
c
->
cmdu_ack_q
);
cntlr_config_clean
(
&
c
->
cfg
);
ubus_free
(
c
->
ubus_ctx
);
cntlr_clean_nodelist
(
c
);
ubus_free
(
ctx
);
uloop_done
();
free
(
c
);
stop_logging
();
return
0
;
}
This diff is collapsed.
Click to expand it.
src/cntlr.h
+
0
−
1
View file @
57b845da
...
...
@@ -411,7 +411,6 @@ struct sta_error_response {
#define COMM_HANDLE(c) (((struct controller *)(c))->ubus_ctx)
extern
int
start_controller
(
void
);
struct
node
*
alloc_node_init
(
struct
controller
*
c
,
uint8_t
*
hwaddr
);
struct
netif_iface
*
find_interface_by_ssid
(
struct
controller
*
c
,
struct
node
*
n
,
char
*
ssid
);
...
...
This diff is collapsed.
Click to expand it.
src/main.c
+
3
−
4
View file @
57b845da
...
...
@@ -22,10 +22,9 @@
#include
"utils/debug.h"
#include
"utils/utils.h"
extern
int
start_controller
(
void
);
extern
int
stop_controller
(
void
);
extern
void
run_controller
(
void
);
const
char
*
PROG_NAME
=
"
wificntl
r"
;
const
char
*
PROG_NAME
=
"
mapcontrolle
r"
;
int
verbose
=
2
;
bool
syslogging
;
bool
usefifo
;
...
...
@@ -103,7 +102,7 @@ int main(int argc, char **argv)
start_logging
();
//init_alloctrace("wificntlr");
start
_controller
();
run
_controller
();
stop_logging
();
...
...
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