[PATCH] openbsc[master]: Remove duplicating define

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/.

Max gerrit-no-reply at lists.osmocom.org
Thu Feb 9 18:32:09 UTC 2017


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

Remove duplicating define

Use GSM_MACBLOCK_LEN consistently throughout abis_rsl.c

Change-Id: I96aec02748a0be0100dee2117f124ff32d5ee3f5
---
M openbsc/src/libbsc/abis_rsl.c
1 file changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/91/1791/1

diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c
index cc190eb..541a86d 100644
--- a/openbsc/src/libbsc/abis_rsl.c
+++ b/openbsc/src/libbsc/abis_rsl.c
@@ -181,13 +181,12 @@
 				   "RSL");
 }
 
-#define MACBLOCK_SIZE	23
 static void pad_macblock(uint8_t *out, const uint8_t *in, int len)
 {
 	memcpy(out, in, len);
 
-	if (len < MACBLOCK_SIZE)
-		memset(out+len, 0x2b, MACBLOCK_SIZE-len);
+	if (len < GSM_MACBLOCK_LEN)
+		memset(out+len, 0x2b, GSM_MACBLOCK_LEN - len);
 }
 
 /* Chapter 9.3.7: Encryption Information */
@@ -1042,7 +1041,7 @@
 {
 	struct msgb *msg = rsl_msgb_alloc();
 	struct abis_rsl_dchan_hdr *dh;
-	uint8_t buf[MACBLOCK_SIZE];
+	uint8_t buf[GSM_MACBLOCK_LEN];
 
 	dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh));
 	init_dchan_hdr(dh, RSL_MT_IMMEDIATE_ASSIGN_CMD);
@@ -1055,7 +1054,8 @@
 	default:
 		/* If phase 2, construct a FULL_IMM_ASS_INFO */
 		pad_macblock(buf, val, len);
-		msgb_tlv_put(msg, RSL_IE_FULL_IMM_ASS_INFO, MACBLOCK_SIZE, buf);
+		msgb_tlv_put(msg, RSL_IE_FULL_IMM_ASS_INFO, GSM_MACBLOCK_LEN,
+			     buf);
 		break;
 	}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I96aec02748a0be0100dee2117f124ff32d5ee3f5
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>



More information about the gerrit-log mailing list