[MERGED] osmo-bts[master]: sysmobts: Fix eeprom padding before gpg key

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

Holger Freyther gerrit-no-reply at lists.osmocom.org
Thu Jul 7 13:51:00 UTC 2016


Holger Freyther has submitted this change and it was merged.

Change subject: sysmobts: Fix eeprom padding before gpg key
......................................................................


sysmobts: Fix eeprom padding before gpg key

Correct the too short padding I introduced in the commit
a55b166c6c7af79cbefe8e65fe77b2d61c634d2d. The result needs to
be 121 and not 120. Add static asserts to make sure it does
not happen again.

Change-Id: I3da7f3b8d3c8e12deb8b805cd15ff52a103d4e56
---
M src/osmo-bts-sysmo/misc/sysmobts_eeprom.h
M src/osmo-bts-sysmo/misc/sysmobts_par.c
2 files changed, 7 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bts-sysmo/misc/sysmobts_eeprom.h b/src/osmo-bts-sysmo/misc/sysmobts_eeprom.h
index ecb86e1..f49db1f 100644
--- a/src/osmo-bts-sysmo/misc/sysmobts_eeprom.h
+++ b/src/osmo-bts-sysmo/misc/sysmobts_eeprom.h
@@ -16,7 +16,7 @@
 	uint16_t model_flags;		/* 34-35 */
 	uint8_t trx_nr;			/* 36 */
 	uint8_t boot_state[48];		/* 37-84 */
-	uint8_t _pad1[35];		/* 85-120 */
+	uint8_t _pad1[36];		/* 85-120 */
 	uint8_t gpg_key[128];		/* 121-249 */
 } __attribute__((packed));
 
diff --git a/src/osmo-bts-sysmo/misc/sysmobts_par.c b/src/osmo-bts-sysmo/misc/sysmobts_par.c
index 6800fde..d1fc37a 100644
--- a/src/osmo-bts-sysmo/misc/sysmobts_par.c
+++ b/src/osmo-bts-sysmo/misc/sysmobts_par.c
@@ -19,6 +19,7 @@
  *
  */
 
+#include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -289,3 +290,8 @@
 
 	return len;
 }
+
+osmo_static_assert(offsetof(struct sysmobts_eeprom, trx_nr) == 36, offset_36);
+osmo_static_assert(offsetof(struct sysmobts_eeprom, boot_state) == 37, offset_37);
+osmo_static_assert(offsetof(struct sysmobts_eeprom, _pad1) == 85, offset_85);
+osmo_static_assert(offsetof(struct sysmobts_eeprom, gpg_key) == 121, offset_121);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3da7f3b8d3c8e12deb8b805cd15ff52a103d4e56
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list