Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
ffbs-gluon
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
darkbit
ffbs-gluon
Commits
f61d2523
Unverified
Commit
f61d2523
authored
6 years ago
by
Matthias Schiffer
Browse files
Options
Downloads
Patches
Plain Diff
gluon-mesh-batman-adv: respondd: do not count batadv clients inactive for more than 60s
parent
af9c1f7e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
package/gluon-mesh-batman-adv/src/respondd.c
+14
-1
14 additions, 1 deletion
package/gluon-mesh-batman-adv/src/respondd.c
with
14 additions
and
1 deletion
package/gluon-mesh-batman-adv/src/respondd.c
+
14
−
1
View file @
f61d2523
...
...
@@ -57,6 +57,9 @@
#define _STRINGIFY(s) #s
#define STRINGIFY(s) _STRINGIFY(s)
#define MAX_INACTIVITY 60000
struct
neigh_netlink_opts
{
struct
json_object
*
interfaces
;
struct
batadv_nlquery_opts
query_opts
;
...
...
@@ -484,6 +487,12 @@ static void count_stations(size_t *wifi24, size_t *wifi5) {
static
const
enum
batadv_nl_attrs
clients_mandatory
[]
=
{
BATADV_ATTR_TT_FLAGS
,
/* Entries without the BATADV_TT_CLIENT_NOPURGE flag do not have a
* BATADV_ATTR_LAST_SEEN_MSECS attribute. We can still make this attr
* mandatory here, as entries without BATADV_TT_CLIENT_NOPURGE are
* ignored anyways.
*/
BATADV_ATTR_LAST_SEEN_MSECS
,
};
static
int
parse_clients_list_netlink_cb
(
struct
nl_msg
*
msg
,
void
*
arg
)
...
...
@@ -493,7 +502,7 @@ static int parse_clients_list_netlink_cb(struct nl_msg *msg, void *arg)
struct
batadv_nlquery_opts
*
query_opts
=
arg
;
struct
genlmsghdr
*
ghdr
;
struct
clients_netlink_opts
*
opts
;
uint32_t
flags
;
uint32_t
flags
,
lastseen
;
opts
=
batadv_container_of
(
query_opts
,
struct
clients_netlink_opts
,
query_opts
);
...
...
@@ -519,6 +528,10 @@ static int parse_clients_list_netlink_cb(struct nl_msg *msg, void *arg)
if
(
flags
&
BATADV_TT_CLIENT_NOPURGE
)
return
NL_OK
;
lastseen
=
nla_get_u32
(
attrs
[
BATADV_ATTR_LAST_SEEN_MSECS
]);
if
(
lastseen
>
MAX_INACTIVITY
)
return
NL_OK
;
if
(
flags
&
BATADV_TT_CLIENT_WIFI
)
opts
->
wifi
++
;
...
...
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