bsc: Allow to disable sending ping/pong to the MSC
Some switches do not like to receive the IPA PING/PONG messages.
Allow to disable the handling with "no timeout-ping" and create
test cases that verify the switching between the modes. Change the
code to trat <= 0 as an invalid timeout.
Fixes: SYS#713
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_api.c b/openbsc/src/osmo-bsc/osmo_bsc_api.c
index 6bda3d4..2c661b3 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_api.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_api.c
@@ -167,7 +167,7 @@
/* Advanced ping/pong handling */
if (osmo_timer_pending(&msc->pong_timer))
send_ping = 0;
- if (msc->ping_timeout == 0)
+ if (msc->ping_timeout <= 0)
send_ping = 0;
if (send_ping && osmo_timer_remaining(&msc->ping_timer, NULL, &tv) == -1)
send_ping = 0;