laforge has submitted this change. (
https://gerrit.osmocom.org/c/osmo-sgsn/+/21460 )
Change subject: gbproxy: Change generic LOG messages so BVCI/NSEI fmt is
consistent
..
gbproxy: Change generic LOG messages so BVCI/NSEI fmt is consistent
We actually need to alter our compiler flags to avoid -Werror=trigraphs
creating trouble:
gb_proxy.c: In function ‘block_unblock_peer’:
gb_proxy.c:875:37: error: trigraph ??) ignored, use -trigraphs to enable
[-Werror=trigraphs]
875 | LOGP(DGPRS, LOGL_ERROR, "BVC(%05u/??) Cannot find BSS\n",
|
Fixes: SYS#5233
Change-Id: I93296353dd964602699480faae1248096e331c6a
---
M configure.ac
M src/gbproxy/gb_proxy.c
M src/gbproxy/gb_proxy_main.c
3 files changed, 44 insertions(+), 42 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/configure.ac b/configure.ac
index 346e020..0ed36b8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -118,8 +118,8 @@
CFLAGS="$saved_CFLAGS"
AC_SUBST(SYMBOL_VISIBILITY)
-CPPFLAGS="$CPPFLAGS -Wall"
-CFLAGS="$CFLAGS -Wall"
+CPPFLAGS="$CPPFLAGS -Wall -Wno-trigraphs"
+CFLAGS="$CFLAGS -Wall -Wno-trigraphs"
AX_CHECK_COMPILE_FLAG([-Werror=implicit], [CFLAGS="$CFLAGS -Werror=implicit"])
AX_CHECK_COMPILE_FLAG([-Werror=maybe-uninitialized], [CFLAGS="$CFLAGS
-Werror=maybe-uninitialized"])
diff --git a/src/gbproxy/gb_proxy.c b/src/gbproxy/gb_proxy.c
index 1602207..2c58e80 100644
--- a/src/gbproxy/gb_proxy.c
+++ b/src/gbproxy/gb_proxy.c
@@ -564,7 +564,7 @@
if (!peer) {
LOGP(DLLC, LOGL_INFO,
-"NSEI=%d(%s) patching: didn't find peer for message, "
+"NSE(%05u/%s) patching: didn't find peer for message, "
"PDU %d\n",
msgb_nsei(msg), parse_ctx->to_bss ? "BSS" : "SGSN",
parse_ctx->pdu_type);
@@ -600,11 +600,11 @@
if (!rc && !parse_ctx.need_decryption) {
LOGP(DGPRS, LOGL_ERROR,
-"NSEI=%u(BSS) patching: failed to parse invalid %s
message\n",
+"NSE(%05u/BSS) patching: failed to parse invalid %s
message\n",
msgb_nsei(msg), gprs_gb_message_name(_ctx,
"NS_UNITDATA"));
gprs_gb_log_parse_context(LOGL_NOTICE, _ctx,
"NS_UNITDATA");
LOGP(DGPRS, LOGL_NOTICE,
-"NSEI=%u(BSS) invalid message was: %s\n",
+"NSE(%05u/BSS) invalid message was: %s\n",
msgb_nsei(msg), msgb_hexdump(msg));
return 0;
}
@@ -717,11 +717,11 @@
if (!rc && !parse_ctx.need_decryption) {
LOGP(DGPRS, LOGL_ERROR,
-"NSEI=%u(SGSN) patching: failed to parse invalid %s
message\n",
+"NSE(%05u/SGSN) patching: failed to parse invalid %s
message\n",
msgb_nsei(msg), gprs_gb_message_name(_ctx,
"NS_UNITDATA"));
gprs_gb_log_parse_context(LOGL_NOTICE, _ctx,
"NS_UNITDATA");
LOGP(DGPRS, LOGL_NOTICE,
-"NSEI=%u(SGSN) invalid message was: %s\n",
+"NSE(%05u/SGSN) invalid message was: %s\n",
msgb_nsei(msg), msgb_hexdump(msg));
return;
}
@@ -794,7 +794,7 @@
struct msgb *msg = bssgp_msgb_copy(old_msg, "msgb_relay2sgsn");
int rc;
- DEBUGP(DGPRS, "NSEI=%u proxying BTS->SGSN (NS_BVCI=%u, NSEI=%u)\n",
+ DEBUGP(DGPRS, "NSE(%05u/BSS)-BVC(%05u) proxying BTS->SGSN
NSE(%05u/SGSN)\n",
msgb_nsei(msg), ns_bvci, sgsn_nsei);
nsp.bvci = ns_bvci;
@@ -824,7 +824,7 @@
uint32_t tlli;
int rc;
- DEBUGP(DGPRS, "NSEI=%u proxying SGSN->BSS (NS_BVCI=%u, NSEI=%u)\n",
+ DEBUGP(DGPRS, "NSE(%05u/SGSN)-BVC(%05u) proxying SGSN->BSS
NSE(%05u/BSS)\n",
msgb_nsei(msg), ns_bvci, nse->nsei);
nsp.bvci = ns_bvci;
@@ -872,7 +872,7 @@
peer = gbproxy_peer_by_bvci(cfg, ptp_bvci);
if (!peer) {
- LOGP(DGPRS, LOGL_ERROR, "BVCI=%u: Cannot find BSS\n",
+ LOGP(DGPRS, LOGL_ERROR, "BVC(%05u/??) Cannot find BSS\n",
ptp_bvci);
rate_ctr_inc(>ctrg->ctr[GBPROX_GLOB_CTR_INV_BVCI]);
return -ENOENT;
@@ -902,7 +902,7 @@
peer = gbproxy_peer_by_bvci(cfg, ptp_bvci);
if (!peer) {
- LOGP(DGPRS, LOGL_ERROR, "BVCI=%u: Cannot find BSS\n",
+ LOGP(DGPRS, LOGL_ERROR, "BVC(%05u/??) Cannot find BSS\n",
ptp_bvci);
rate_ctr_inc(>ctrg->ctr[GBPROX_GLOB_CTR_INV_BVCI]);
return -ENOENT;
@@ -928,8 +928,8 @@
peer = gbproxy_peer_by_bvci(cfg, ns_bvci);
if (!peer) {
- LOGP(DGPRS, LOGL_NOTICE, "Didn't find peer for "
-"BVCI=%u for PTP message from NSEI=%u (BSS), "
+ LOGP(DGPRS,