pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-gbproxy/+/41888?usp=email )


Change subject: Avoid accessing struct log_target members directly
......................................................................

Avoid accessing struct log_target members directly

Use newly available APIs instead.

Depends: libosmocore.git Change-Id Ie48e7e635feb91509b9c034394df4fb16cb931a3
Change-Id: I3d33a8d80d13835be21742f98d2357a3447c8374
---
M TODO-RELEASE
M src/gb_proxy_vty.c
2 files changed, 6 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-gbproxy refs/changes/88/41888/1

diff --git a/TODO-RELEASE b/TODO-RELEASE
index 0ed7189..fb115da 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -7,3 +7,4 @@
 # If any interfaces have been added since the last public release: c:r:a + 1.
 # If any interfaces have been removed or changed since the last public 
release: c:r:0.
 #library       what                    description / commit summary line
+libosmocore >1.12.0 log_get_context(), log_{get,set}_filter(_data)()
diff --git a/src/gb_proxy_vty.c b/src/gb_proxy_vty.c
index e5f53e2..80daac3 100644
--- a/src/gb_proxy_vty.c
+++ b/src/gb_proxy_vty.c
@@ -474,11 +474,11 @@
 {
        if (bvci) {
                uintptr_t bvci_filter = *bvci | BVC_LOG_CTX_FLAG;
-               target->filter_map |= (1 << LOG_FLT_GB_BVC);
-               target->filter_data[LOG_FLT_GB_BVC] = (void *)bvci_filter;
-       } else if (target->filter_data[LOG_FLT_GB_BVC]) {
-               target->filter_map = ~(1 << LOG_FLT_GB_BVC);
-               target->filter_data[LOG_FLT_GB_BVC] = NULL;
+               log_set_filter(target, LOG_FLT_GB_BVC, true);
+               log_set_filter_data(target, LOG_FLT_GB_BVC, (void 
*)bvci_filter);
+       } else if (log_get_filter(target, LOG_FLT_GB_BVC)) {
+               log_set_filter(target, LOG_FLT_GB_BVC, false);
+               log_set_filter_data(target, LOG_FLT_GB_BVC, NULL);
        }
 }


--
To view, visit https://gerrit.osmocom.org/c/osmo-gbproxy/+/41888?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: osmo-gbproxy
Gerrit-Branch: master
Gerrit-Change-Id: I3d33a8d80d13835be21742f98d2357a3447c8374
Gerrit-Change-Number: 41888
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>

Reply via email to