[PATCH] osmo-mgw[master]: protocol: prohibit wildcarded requests for MDCX and DLCX

2018-02-05 Thread dexter
Hello Harald Welte, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/6260

to look at the new patch set (#4).

protocol: prohibit wildcarded requests for MDCX and DLCX

When a wildcarded request is made with a DLCX or MDCX command
the MGW will search for a free endpoint and continues the command
execution with that endpoint.

- Catch the wildcarded request early on DLCX and MDCX and return
  with an error code.

See also TTCN3 testcases:
MGCP_Test.TC_mdcx_wildcarded
MGCP_Test.TC_dlcx_wildcarded

Change-Id: Ia77d44a6a86083e62338e5845b553e5cf13ebd10
---
M src/libosmo-mgcp/mgcp_protocol.c
1 file changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/60/6260/4

diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index 62487d1..ea86672 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -739,6 +739,14 @@
 
LOGP(DLMGCP, LOGL_NOTICE, "MDCX: modifying existing connection ...\n");
 
+   /* Prohibit wildcarded requests */
+   if (endp->wildcarded_req) {
+   LOGP(DLMGCP, LOGL_ERROR,
+"MDCX: endpoint:0x%x wildcarded endpoint names not 
supported.\n",
+ENDPOINT_NUMBER(endp));
+   return create_err_response(endp, 507, "MDCX", p->trans);
+   }
+
if (llist_count(>conns) <= 0) {
LOGP(DLMGCP, LOGL_ERROR,
 "MDCX: endpoint:0x%x endpoint is not holding a 
connection.\n",
@@ -912,6 +920,14 @@
 "DLCX: endpoint:0x%x deleting connection ...\n",
 ENDPOINT_NUMBER(endp));
 
+   /* Prohibit wildcarded requests */
+   if (endp->wildcarded_req) {
+   LOGP(DLMGCP, LOGL_ERROR,
+"DLCX: endpoint:0x%x wildcarded endpoint names not 
supported.\n",
+ENDPOINT_NUMBER(endp));
+   return create_err_response(endp, 507, "DLCX", p->trans);
+   }
+
if (llist_count(>conns) <= 0) {
LOGP(DLMGCP, LOGL_ERROR,
 "DLCX: endpoint:0x%x endpoint is not holding a 
connection.\n",

-- 
To view, visit https://gerrit.osmocom.org/6260
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia77d44a6a86083e62338e5845b553e5cf13ebd10
Gerrit-PatchSet: 4
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 


[PATCH] osmo-mgw[master]: protocol: prohibit wildcarded requests for MDCX and DLCX

2018-02-05 Thread dexter
Hello Harald Welte, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/6260

to look at the new patch set (#3).

protocol: prohibit wildcarded requests for MDCX and DLCX

When a wildcarded request is made with a DLCX or MDCX command
the MGW will search for a free endpoint and continues the command
execution with that endpoint.

- Catch the wildcarded request early on DLCX and MDCX and return
  with an error code.

See also TTCN3 testcases:
MGCP_Test.TC_mdcx_wildcarded
MGCP_Test.TC_dlcx_wildcarded

Change-Id: Ia77d44a6a86083e62338e5845b553e5cf13ebd10
---
M src/libosmo-mgcp/mgcp_protocol.c
1 file changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/60/6260/3

diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index 62487d1..49e1ead 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -739,6 +739,14 @@
 
LOGP(DLMGCP, LOGL_NOTICE, "MDCX: modifying existing connection ...\n");
 
+   /* Prohibit wildcarded requests */
+   if (endp->wildcarded_req) {
+   LOGP(DLMGCP, LOGL_ERROR,
+"DLCX: endpoint:0x%x wildcarded endpoint names not 
supported.\n",
+ENDPOINT_NUMBER(endp));
+   return create_err_response(endp, 507, "MDCX", p->trans);
+   }
+
if (llist_count(>conns) <= 0) {
LOGP(DLMGCP, LOGL_ERROR,
 "MDCX: endpoint:0x%x endpoint is not holding a 
connection.\n",
@@ -912,6 +920,14 @@
 "DLCX: endpoint:0x%x deleting connection ...\n",
 ENDPOINT_NUMBER(endp));
 
+   /* Prohibit wildcarded requests */
+   if (endp->wildcarded_req) {
+   LOGP(DLMGCP, LOGL_ERROR,
+"DLCX: endpoint:0x%x wildcarded endpoint names not 
supported.\n",
+ENDPOINT_NUMBER(endp));
+   return create_err_response(endp, 507, "DLCX", p->trans);
+   }
+
if (llist_count(>conns) <= 0) {
LOGP(DLMGCP, LOGL_ERROR,
 "DLCX: endpoint:0x%x endpoint is not holding a 
connection.\n",

-- 
To view, visit https://gerrit.osmocom.org/6260
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia77d44a6a86083e62338e5845b553e5cf13ebd10
Gerrit-PatchSet: 3
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 


[PATCH] osmo-mgw[master]: protocol: prohibit wildcarded requests for MDCX and DLCX

2018-02-02 Thread dexter
Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/6260

to look at the new patch set (#2).

protocol: prohibit wildcarded requests for MDCX and DLCX

When a wildcarded request is made with a DLCX or MDCX command
the MGW will search for a free endpoint and continues the command
execution with that endpoint.

- Catch the wildcarded request early on DLCX and MDCX and return
  with an error code.

See also TTCN3 testcases:
MGCP_Test.TC_mdcx_wildcarded
MGCP_Test.TC_dlcx_wildcarded

Change-Id: Ia77d44a6a86083e62338e5845b553e5cf13ebd10
---
M src/libosmo-mgcp/mgcp_protocol.c
1 file changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/60/6260/2

diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index 337aa9b..5fbea10 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -739,6 +739,14 @@
 
LOGP(DLMGCP, LOGL_NOTICE, "MDCX: modifying existing connection ...\n");
 
+   /* Prohibit wildcarded requests */
+   if (endp->wildcarded_req) {
+   LOGP(DLMGCP, LOGL_ERROR,
+"DLCX: endpoint:0x%x wildcarded endpoint names not 
supported.\n",
+ENDPOINT_NUMBER(endp));
+   return create_err_response(endp, 507, "DLCX", p->trans);
+   }
+
if (llist_count(>conns) <= 0) {
LOGP(DLMGCP, LOGL_ERROR,
 "MDCX: endpoint:0x%x endpoint is not holding a 
connection.\n",
@@ -912,6 +920,14 @@
 "DLCX: endpoint:0x%x deleting connection ...\n",
 ENDPOINT_NUMBER(endp));
 
+   /* Prohibit wildcarded requests */
+   if (endp->wildcarded_req) {
+   LOGP(DLMGCP, LOGL_ERROR,
+"DLCX: endpoint:0x%x wildcarded endpoint names not 
supported.\n",
+ENDPOINT_NUMBER(endp));
+   return create_err_response(endp, 507, "DLCX", p->trans);
+   }
+
if (llist_count(>conns) <= 0) {
LOGP(DLMGCP, LOGL_ERROR,
 "DLCX: endpoint:0x%x endpoint is not holding a 
connection.\n",

-- 
To view, visit https://gerrit.osmocom.org/6260
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia77d44a6a86083e62338e5845b553e5cf13ebd10
Gerrit-PatchSet: 2
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder


[PATCH] osmo-mgw[master]: protocol: prohibit wildcarded requests for MDCX and DLCX

2018-02-02 Thread dexter

Review at  https://gerrit.osmocom.org/6260

protocol: prohibit wildcarded requests for MDCX and DLCX

When a wildcarded request is made with a DLCX or MDCX command
the MGW will search for a free endpoint and continues the command
execution with that endpoint.

- Catch the wildcarded request early on DLCX and MDCX and return
  with an error code.

See also TTCN3 testcases:
MGCP_Test.TC_mdcx_wildcarded
MGCP_Test.TC_dlcx_wildcarded

Change-Id: Ia77d44a6a86083e62338e5845b553e5cf13ebd10
---
M src/libosmo-mgcp/mgcp_protocol.c
1 file changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/60/6260/1

diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index 337aa9b..5fbea10 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -739,6 +739,14 @@
 
LOGP(DLMGCP, LOGL_NOTICE, "MDCX: modifying existing connection ...\n");
 
+   /* Prohibit wildcarded requests */
+   if (endp->wildcarded_req) {
+   LOGP(DLMGCP, LOGL_ERROR,
+"DLCX: endpoint:0x%x wildcarded endpoint names not 
supported.\n",
+ENDPOINT_NUMBER(endp));
+   return create_err_response(endp, 507, "DLCX", p->trans);
+   }
+
if (llist_count(>conns) <= 0) {
LOGP(DLMGCP, LOGL_ERROR,
 "MDCX: endpoint:0x%x endpoint is not holding a 
connection.\n",
@@ -912,6 +920,14 @@
 "DLCX: endpoint:0x%x deleting connection ...\n",
 ENDPOINT_NUMBER(endp));
 
+   /* Prohibit wildcarded requests */
+   if (endp->wildcarded_req) {
+   LOGP(DLMGCP, LOGL_ERROR,
+"DLCX: endpoint:0x%x wildcarded endpoint names not 
supported.\n",
+ENDPOINT_NUMBER(endp));
+   return create_err_response(endp, 507, "DLCX", p->trans);
+   }
+
if (llist_count(>conns) <= 0) {
LOGP(DLMGCP, LOGL_ERROR,
 "DLCX: endpoint:0x%x endpoint is not holding a 
connection.\n",

-- 
To view, visit https://gerrit.osmocom.org/6260
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia77d44a6a86083e62338e5845b553e5cf13ebd10
Gerrit-PatchSet: 1
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter