Change in osmo-hlr[master]: hlr.c: check the presence of msgb->l2h in read_cb()

2019-05-07 Thread Vadim Yanitskiy
Vadim Yanitskiy has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13899 )

Change subject: hlr.c: check the presence of msgb->l2h in read_cb()
..

hlr.c: check the presence of msgb->l2h in read_cb()

Checking the presence of msgb->l2h in read_cb_forward() doesn't
make sense, since in read_cb() we pass it to osmo_gsup_decode().
Let's rather do this before calling osmo_gsup_decode().

Fix for Change-Id: Ia4f345abc877baaf0a8f73b8988e6514d9589bf5
Change-Id: I69a3d31aacbbb1abef3d83e42e46c899fe2f914b
---
M src/hlr.c
1 file changed, 6 insertions(+), 6 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved
  Neels Hofmeyr: Looks good to me, approved



diff --git a/src/hlr.c b/src/hlr.c
index 3df700a..84daa47 100644
--- a/src/hlr.c
+++ b/src/hlr.c
@@ -483,11 +483,6 @@
goto end;
}

-   if (!msgb_l2(msg) || !msgb_l2len(msg)) {
-   LOGP_GSUP_FWD(gsup, LOGL_ERROR, "missing or empty l2 data\n");
-   goto end;
-   }
-
/* Forward message without re-encoding (so we don't remove unknown IEs) 
*/
LOGP_GSUP_FWD(gsup, LOGL_INFO, "checks passed, forwarding\n");

@@ -524,10 +519,15 @@
static struct osmo_gsup_message gsup;
int rc;

+   if (!msgb_l2(msg) || !msgb_l2len(msg)) {
+   LOGP(DMAIN, LOGL_ERROR, "missing or empty L2 data\n");
+   return -EINVAL; /* FIXME: msgb_free(msg); */
+   }
+
rc = osmo_gsup_decode(msgb_l2(msg), msgb_l2len(msg), );
if (rc < 0) {
LOGP(DMAIN, LOGL_ERROR, "error in GSUP decode: %d\n", rc);
-   return rc;
+   return rc; /* FIXME: msgb_free(msg); */
}

/* 3GPP TS 23.003 Section 2.2 clearly states that an IMSI with less 
than 5

--
To view, visit https://gerrit.osmocom.org/13899
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I69a3d31aacbbb1abef3d83e42e46c899fe2f914b
Gerrit-Change-Number: 13899
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmo-hlr[master]: hlr.c: check the presence of msgb->l2h in read_cb()

2019-05-07 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13899 )

Change subject: hlr.c: check the presence of msgb->l2h in read_cb()
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/13899
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I69a3d31aacbbb1abef3d83e42e46c899fe2f914b
Gerrit-Change-Number: 13899
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Tue, 07 May 2019 14:40:17 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-hlr[master]: hlr.c: check the presence of msgb->l2h in read_cb()

2019-05-07 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/13899 )

Change subject: hlr.c: check the presence of msgb->l2h in read_cb()
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/13899
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I69a3d31aacbbb1abef3d83e42e46c899fe2f914b
Gerrit-Change-Number: 13899
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Comment-Date: Tue, 07 May 2019 14:42:13 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-hlr[master]: hlr.c: check the presence of msgb->l2h in read_cb()

2019-05-07 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/13899


Change subject: hlr.c: check the presence of msgb->l2h in read_cb()
..

hlr.c: check the presence of msgb->l2h in read_cb()

Checking the presence of msgb->l2h in read_cb_forward() doesn't
make sense, since in read_cb() we pass it to osmo_gsup_decode().
Let's rather do this before calling osmo_gsup_decode().

Fix for Change-Id: Ia4f345abc877baaf0a8f73b8988e6514d9589bf5
Change-Id: I69a3d31aacbbb1abef3d83e42e46c899fe2f914b
---
M src/hlr.c
1 file changed, 6 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/99/13899/1

diff --git a/src/hlr.c b/src/hlr.c
index 3df700a..84daa47 100644
--- a/src/hlr.c
+++ b/src/hlr.c
@@ -483,11 +483,6 @@
goto end;
}

-   if (!msgb_l2(msg) || !msgb_l2len(msg)) {
-   LOGP_GSUP_FWD(gsup, LOGL_ERROR, "missing or empty l2 data\n");
-   goto end;
-   }
-
/* Forward message without re-encoding (so we don't remove unknown IEs) 
*/
LOGP_GSUP_FWD(gsup, LOGL_INFO, "checks passed, forwarding\n");

@@ -524,10 +519,15 @@
static struct osmo_gsup_message gsup;
int rc;

+   if (!msgb_l2(msg) || !msgb_l2len(msg)) {
+   LOGP(DMAIN, LOGL_ERROR, "missing or empty L2 data\n");
+   return -EINVAL; /* FIXME: msgb_free(msg); */
+   }
+
rc = osmo_gsup_decode(msgb_l2(msg), msgb_l2len(msg), );
if (rc < 0) {
LOGP(DMAIN, LOGL_ERROR, "error in GSUP decode: %d\n", rc);
-   return rc;
+   return rc; /* FIXME: msgb_free(msg); */
}

/* 3GPP TS 23.003 Section 2.2 clearly states that an IMSI with less 
than 5

--
To view, visit https://gerrit.osmocom.org/13899
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I69a3d31aacbbb1abef3d83e42e46c899fe2f914b
Gerrit-Change-Number: 13899
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy