Change in osmo-pcu[master]: llc: use memset to fill llc dummy frame padding

pespin gerrit-no-reply at lists.osmocom.org
Tue Mar 2 12:24:15 UTC 2021


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/23191 )

Change subject: llc: use memset to fill llc dummy frame padding
......................................................................

llc: use memset to fill llc dummy frame padding

Change-Id: Iaa55549f979ca23dad0bddd308c1144aa4b17255
---
M src/llc.cpp
1 file changed, 4 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/src/llc.cpp b/src/llc.cpp
index 470e154..e508d0b 100644
--- a/src/llc.cpp
+++ b/src/llc.cpp
@@ -59,8 +59,10 @@
 
 	/* Add further stuffing, if the requested length exceeds the minimum
 	 * dummy command length */
-	while (m_length < req_len)
-		frame[m_length++] = 0x2b;
+	if (m_length < req_len) {
+		memset(&frame[m_length], 0x2b, req_len - m_length);
+		m_length = req_len;
+	}
 }
 
 void gprs_llc::put_frame(const uint8_t *data, size_t len)

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/23191
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: Iaa55549f979ca23dad0bddd308c1144aa4b17255
Gerrit-Change-Number: 23191
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210302/4e193815/attachment.htm>


More information about the gerrit-log mailing list