Skip to content

Commit

Permalink
feat: optimize client lookup by allowing counter updates based on IP …
Browse files Browse the repository at this point in the history
…alone

Signed-off-by: Dengfeng Liu <[email protected]>
  • Loading branch information
liudf0716 committed Feb 1, 2025
1 parent 200484e commit 9d5f615
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/fw_nft.c
Original file line number Diff line number Diff line change
Expand Up @@ -1158,8 +1158,8 @@ process_nftables_expr(json_object *jobj_expr, int is_outgoing)
}

// Only update counters if we found both counter data and client identifiers
if (has_counter && (ip || mac)) {
t_client *client = client_list_find(ip, mac);
if (has_counter && ip) {
t_client *client = mac?client_list_find(ip, mac):client_list_find_by_ip(ip);
if (client) {
update_client_counters(client, packets, bytes, is_outgoing, is_ip6);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

#ifndef _VERSION_
#define _VERSION_
#define VERSION "8.02.2350"
#define VERSION "8.02.2352"
#endif

0 comments on commit 9d5f615

Please sign in to comment.