ns: Log when sending fails (Coverity)
Currently the return value of the gprs_ns_tx family of functions is
often ignored. This is not a serious issue, since the successful
delivery of the messages is neither guaranteed nor acknowledged by
the network layer anyway.
Nevertheless this commit adds logging (level INFO) to gprs_ns_tx and
gprs_ns_msgb_alloc. The definition of the latter has been moved from
the header file to gprs_ns.c.
Fixes: Coverity CID 1040678, 1040679, 1040680, 1040681, 1040682,
1040683, 1040684, 1040686, 1040687, 1040688, 1111545,
1240203, 1240204
Sponsored-by: On-Waves ehf
diff --git a/include/osmocom/gprs/gprs_ns.h b/include/osmocom/gprs/gprs_ns.h
index e77ca42..d5a605d 100644
--- a/include/osmocom/gprs/gprs_ns.h
+++ b/include/osmocom/gprs/gprs_ns.h
@@ -23,6 +23,9 @@
"Alive Timer (Tns-alive) timeout\n" \
"Alive Timer (Tns-alive) number of retries\n"
+#define NS_ALLOC_SIZE 2048
+#define NS_ALLOC_HEADROOM 20
+
enum ns_timeout {
NS_TOUT_TNS_BLOCK,
NS_TOUT_TNS_BLOCK_RETRIES,
@@ -186,12 +189,7 @@
/* Clear the link layer info (will never match a real link then) */
void gprs_ns_ll_clear(struct gprs_nsvc *nsvc);
-#define NS_ALLOC_SIZE 2048
-#define NS_ALLOC_HEADROOM 20
-static inline struct msgb *gprs_ns_msgb_alloc(void)
-{
- return msgb_alloc_headroom(NS_ALLOC_SIZE, NS_ALLOC_HEADROOM, "GPRS/NS");
-}
+struct msgb *gprs_ns_msgb_alloc(void);
enum signal_ns {
S_NS_RESET,