gbproxy_ctrl: Ignore SIG-BVCI in ctrl commands
Both ctrl commands gbproxy-state and number-of-peers should only
operate on PtP-BVCs. This patch avoids a crash in gbproxy-state and
fixes the count of number-of-peers to only include PtP-BVCs.
Related: SYS#5542, OS#5200
Change-Id: Ida5f9ad0a16b991e77eec0e3cdb779dcfa472fab
diff --git a/src/gb_proxy_ctrl.c b/src/gb_proxy_ctrl.c
index 99dcbe1..1d51d22 100644
--- a/src/gb_proxy_ctrl.c
+++ b/src/gb_proxy_ctrl.c
@@ -103,6 +103,9 @@
hash_for_each(cfg->bss_nses, i, nse_peer, list) {
struct gbproxy_bvc *bvc;
hash_for_each(nse_peer->bvcs, j, bvc, list) {
+ if (bvc->bvci == 0)
+ continue;
+
struct gprs_ra_id *raid = &bvc->cell->id.raid;
cmd->reply = talloc_asprintf_append(cmd->reply, "%u,%u,%u-%u-%u-%u,%s\n",
@@ -127,8 +130,11 @@
int i, j;
hash_for_each(cfg->bss_nses, i, nse_peer, list) {
- hash_for_each(nse_peer->bvcs, j, bvc, list)
+ hash_for_each(nse_peer->bvcs, j, bvc, list) {
+ if (bvc->bvci == 0)
+ continue;
count++;
+ }
}
cmd->reply = talloc_strdup(cmd, "");