Skip to content

Commit

Permalink
Merge pull request #15361 from idryzhov/fix-be-interested
Browse files Browse the repository at this point in the history
mgmtd: fix be_is_client_interested
  • Loading branch information
choppsv1 authored Feb 13, 2024
2 parents 26faf34 + 745a2bd commit 60cb834
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions mgmtd/mgmt_be_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -925,22 +925,17 @@ uint64_t mgmt_be_interested_clients(const char *xpath, bool config)
static bool be_is_client_interested(const char *xpath,
enum mgmt_be_client_id id, bool config)
{
const char *const *xpaths;
uint64_t clients;

assert(id < MGMTD_BE_CLIENT_ID_MAX);

__dbg("Checking client: %s for xpath: '%s'", mgmt_be_client_id2name(id),
xpath);

xpaths = config ? be_client_config_xpaths[id]
: be_client_oper_xpaths[id];
if (xpaths) {
for (; *xpaths; xpaths++) {
if (mgmt_be_xpath_prefix(*xpaths, xpath)) {
__dbg("xpath: %s: matched: %s", *xpaths, xpath);
return true;
}
}
clients = mgmt_be_interested_clients(xpath, config);
if (IS_IDBIT_SET(clients, id)) {
__dbg("client: %s: interested", mgmt_be_client_id2name(id));
return true;
}

__dbg("client: %s: not interested", mgmt_be_client_id2name(id));
Expand Down

0 comments on commit 60cb834

Please sign in to comment.