GPRS: We have to do the msgb_free() in NS not Gb Proxy
As only NS-UNITDATA messages are ever passed into the Gb Proxy,
we need to do the msgb_free() at a much higher point in the calling
stack, i.e. inside the NS protocol layer. This means it is now
the same logic as in OpenBSC itself.
diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c
index 7203a4b..ffaf240 100644
--- a/openbsc/src/gprs/gb_proxy.c
+++ b/openbsc/src/gprs/gb_proxy.c
@@ -491,10 +491,6 @@
}
}
- /* We free the original message here, as we will have created a
- * copy in case it is forwarded to another peer */
- msgb_free(msg);
-
return rc;
}
diff --git a/openbsc/src/gprs/gprs_ns.c b/openbsc/src/gprs/gprs_ns.c
index 1b9d7c6..11637f7 100644
--- a/openbsc/src/gprs/gprs_ns.c
+++ b/openbsc/src/gprs/gprs_ns.c
@@ -793,7 +793,11 @@
if (!msg)
return error;
- return gprs_ns_rcvmsg(nsi, msg, &saddr);
+ error = gprs_ns_rcvmsg(nsi, msg, &saddr);
+
+ msgb_free(msg);
+
+ return error;
}
static int handle_nsip_write(struct bsc_fd *bfd)