This commit is contained in:
Mat M 2018-02-26 05:40:48 +00:00 committed by GitHub
commit 58888fced7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 5 deletions

View File

@ -52,7 +52,7 @@ uint32_t configitem_get(enum ConfigItem item, uint64_t *p_outvalue) {
break; break;
case CONFIGITEM_VERSION: case CONFIGITEM_VERSION:
/* Always returns maxver - 1 on hardware. */ /* Always returns maxver - 1 on hardware. */
*p_outvalue = PACKAGE2_MAXVER_400_CURRENT - 1; *p_outvalue = PACKAGE2_MAXVER_CURRENT - 1;
break; break;
case CONFIGITEM_HARDWARETYPE: case CONFIGITEM_HARDWARETYPE:
*p_outvalue = fuse_get_hardware_type(); *p_outvalue = fuse_get_hardware_type();

View File

@ -271,7 +271,7 @@ static bool validate_package2_metadata(package2_meta_t *metadata) {
/* Perform version checks. */ /* Perform version checks. */
/* We will be compatible with all package2s released before current, but not newer ones. */ /* We will be compatible with all package2s released before current, but not newer ones. */
if (metadata->version_max >= PACKAGE2_MINVER_THEORETICAL && metadata->version_min < PACKAGE2_MAXVER_400_CURRENT) { if (metadata->version_max >= PACKAGE2_MINVER_THEORETICAL && metadata->version_min < PACKAGE2_MAXVER_CURRENT) {
return false; return false;
} }

View File

@ -30,18 +30,22 @@
#define PACKAGE2_SIZE_MAX 0x7FC000 #define PACKAGE2_SIZE_MAX 0x7FC000
#define PACKAGE2_SECTION_MAX 0x3 #define PACKAGE2_SECTION_MAX 0x3
#define PACKAGE2_MINVER_THEORETICAL 0x0
#define PACKAGE2_MAXVER_100 0x2 #define PACKAGE2_MAXVER_100 0x2
#define PACKAGE2_MAXVER_200 0x3 #define PACKAGE2_MAXVER_200 0x3
#define PACKAGE2_MAXVER_300 0x4 #define PACKAGE2_MAXVER_300 0x4
#define PACKAGE2_MAXVER_302 0x5 #define PACKAGE2_MAXVER_302 0x5
#define PACKAGE2_MAXVER_400_CURRENT 0x6 #define PACKAGE2_MAXVER_400 0x6
/* NOTE: This define should be updated if a newer MAXVER is added */
#define PACKAGE2_MAXVER_CURRENT PACKAGE2_MAXVER_400
#define PACKAGE2_MINVER_THEORETICAL 0x0
#define PACKAGE2_MINVER_100 0x3 #define PACKAGE2_MINVER_100 0x3
#define PACKAGE2_MINVER_200 0x4 #define PACKAGE2_MINVER_200 0x4
#define PACKAGE2_MINVER_300 0x5 #define PACKAGE2_MINVER_300 0x5
#define PACKAGE2_MINVER_302 0x6 #define PACKAGE2_MINVER_302 0x6
#define PACKAGE2_MINVER_400_CURRENT 0x7 #define PACKAGE2_MINVER_400 0x7
/* NOTE: This define should be updated if a newer MINVER is added */
#define PACKAGE2_MINVER_CURRENT PACKAGE2_MINVER_400
#pragma pack(push, 1) #pragma pack(push, 1)