gbproxy: Add a hint to the compiler that all parameters are not NULL
In these functions we assume that peer is not NULL. Add a compiler
attribute in the hope that either coverity or GCC/Clang will help
us to find a misusage.
Done with Jacob
diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c
index ff480de..efd35e0 100644
--- a/openbsc/src/gprs/gb_proxy.c
+++ b/openbsc/src/gprs/gb_proxy.c
@@ -1005,6 +1005,10 @@
static int gbprox_patch_dtap(struct msgb *msg, uint8_t *data, size_t data_len,
struct gbproxy_peer *peer, int *len_change,
+ struct gbproxy_parse_context *parse_ctx) __attribute__((nonnull));
+
+static int gbprox_patch_dtap(struct msgb *msg, uint8_t *data, size_t data_len,
+ struct gbproxy_peer *peer, int *len_change,
struct gbproxy_parse_context *parse_ctx)
{
struct gsm48_hdr *g48h;
@@ -1077,6 +1081,10 @@
static void gbprox_patch_llc(struct msgb *msg, uint8_t *llc, size_t llc_len,
struct gbproxy_peer *peer, int *len_change,
+ struct gbproxy_parse_context *parse_ctx) __attribute__((nonnull));
+
+static void gbprox_patch_llc(struct msgb *msg, uint8_t *llc, size_t llc_len,
+ struct gbproxy_peer *peer, int *len_change,
struct gbproxy_parse_context *parse_ctx)
{
struct gprs_llc_hdr_parsed ghp = {0};