File 0001-Fix-remote-CAPI-sent-CAPI-Message-length.patch of Package libcapi20

From ab43fb062622da60131ab5a0d3d51940df14408e Mon Sep 17 00:00:00 2001
From: Martin Hauke <mardnh@gmx.de>
Date: Sat, 22 Oct 2022 11:19:53 +0200
Subject: [PATCH] Fix remote CAPI (sent CAPI-Message length)

Without this change Bintec routers discard incoming remote CAPI
packets with the following error:
"ERR/CAPI: ERR(013217457) APPL-1:07 got too short CAPI message"

Note: Bintec user authentication is not yet implemented.
You need to disable CAPI authentication on your Bintec router:
 -> "capiUserTable" must be be empty.
---
 capi_mod_rcapi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/capi_mod_rcapi.c b/capi_mod_rcapi.c
index 367f7fa..c795575 100644
--- a/capi_mod_rcapi.c
+++ b/capi_mod_rcapi.c
@@ -180,7 +180,8 @@ static int rcapiRemoteCommand( int nHandle, unsigned char *pnBuffer, int nLen, i
 static void rcapiSetHeader( unsigned char **ppnPtr, int nLen, _cword nCmd, _cdword nCtrl ) {
 	/* length of message */
 	put_netword( ppnPtr, nLen );
-	put_word( ppnPtr, 0 );
+	/* length of CAPI message */
+	put_word( ppnPtr, nLen - 2 );
 	put_word( ppnPtr, 0 );
 	/* command id */
 	put_netword( ppnPtr, nCmd );
-- 
2.38.0

openSUSE Build Service is sponsored by