Skip to content

Commit

Permalink
fix: handle unknown IP and MAC addresses in query_bypass_user_status
Browse files Browse the repository at this point in the history
Signed-off-by: Dengfeng Liu <[email protected]>
  • Loading branch information
liudf0716 committed Feb 5, 2025
1 parent 84d9b39 commit 07548ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/bypass_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -652,10 +652,12 @@ query_bypass_user_status(const char *key, const char *gw_mac, const char *gw_add
if (!found) {
if (choice == QUERY_BY_MAC) {
char *ip = get_user_ip_by_mac(key);
if (!ip) ip = safe_strdup("unknown");
add_not_found_status(j_status, key, ip, gw_mac, gw_address);
free(ip);
} else {
char *mac = get_user_mac_by_ip(key);
if (!mac) mac = safe_strdup("unknown");
add_not_found_status(j_status, mac, key, gw_mac, gw_address);
free(mac);
}
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.2374"
#define VERSION "8.02.2375"
#endif

0 comments on commit 07548ed

Please sign in to comment.