This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Stefan Sperling gerrit-no-reply at lists.osmocom.orgStefan Sperling has submitted this change and it was merged. ( https://gerrit.osmocom.org/11287 )
Change subject: add support for ipaccess messages on the ctrl interface
......................................................................
add support for ipaccess messages on the ctrl interface
In ctrl_handle_msg(), check for IPACCESS protocol messages and respond
to such messages in the same way as ipa_ccm_rcvmsg_base() does. This will
allow the TTCN3 IPA "chopped ping" test to pass on control interfaces.
Change-Id: I9d7137c830981ccad03806b30b776e2b1f1b4699
Related: OS#2010
---
M src/ctrl/control_if.c
1 file changed, 32 insertions(+), 8 deletions(-)
Approvals:
Harald Welte: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/ctrl/control_if.c b/src/ctrl/control_if.c
index 5962f7e..ed18a2f 100644
--- a/src/ctrl/control_if.c
+++ b/src/ctrl/control_if.c
@@ -389,20 +389,44 @@
struct ipaccess_head_ext *iph_ext;
int result;
+ if (msg->len < sizeof(*iph)) {
+ LOGP(DLCTRL, LOGL_ERROR, "The message is too short.\n");
+ return -EINVAL;
+ }
+ iph = (struct ipaccess_head *) msg->data;
+ if (iph->proto == IPAC_PROTO_IPACCESS) {
+ uint8_t msg_type = *(msg->l2h);
+ switch (msg_type) {
+ case IPAC_MSGT_PING:
+ if (ipa_ccm_send_pong(ccon->write_queue.bfd.fd) < 0)
+ LOGP(DLINP, LOGL_ERROR, "Cannot send PONG message. Reason: %s\n", strerror(errno));
+ break;
+ case IPAC_MSGT_PONG:
+ break;
+ case IPAC_MSGT_ID_ACK:
+ if (ipa_ccm_send_id_ack(ccon->write_queue.bfd.fd) < 0)
+ LOGP(DLINP, LOGL_ERROR, "Cannot send ID_ACK message. Reason: %s\n", strerror(errno));
+ break;
+ default:
+ LOGP(DLCTRL, LOGL_DEBUG, "Received unhandled IPACCESS protocol message of type 0x%x: %s\n",
+ msg_type, msgb_hexdump(msg));
+ break;
+ }
+ return 0;
+ }
+ if (iph->proto != IPAC_PROTO_OSMO) {
+ LOGP(DLCTRL, LOGL_ERROR, "Protocol mismatch. Received protocol 0x%x message: %s\n",
+ iph->proto, msgb_hexdump(msg));
+ return -EINVAL;
+ }
if (msg->len < sizeof(*iph) + sizeof(*iph_ext)) {
LOGP(DLCTRL, LOGL_ERROR, "The message is too short.\n");
return -EINVAL;
}
-
- iph = (struct ipaccess_head *) msg->data;
- if (iph->proto != IPAC_PROTO_OSMO) {
- LOGP(DLCTRL, LOGL_ERROR, "Protocol mismatch. We got 0x%x\n", iph->proto);
- return -EINVAL;
- }
-
iph_ext = (struct ipaccess_head_ext *) iph->data;
if (iph_ext->proto != IPAC_PROTO_EXT_CTRL) {
- LOGP(DLCTRL, LOGL_ERROR, "Extended protocol mismatch. We got 0x%x\n", iph_ext->proto);
+ LOGP(DLCTRL, LOGL_ERROR, "Extended protocol mismatch. Received protocol 0x%x message: %s\n",
+ iph_ext->proto, msgb_hexdump(msg));
return -EINVAL;
}
--
To view, visit https://gerrit.osmocom.org/11287
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I9d7137c830981ccad03806b30b776e2b1f1b4699
Gerrit-Change-Number: 11287
Gerrit-PatchSet: 2
Gerrit-Owner: Stefan Sperling <ssperling at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Stefan Sperling <ssperling at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181015/2e32848e/attachment.htm>