To help diagnosing issues with stock firmware refusing OpenWrt factory
images, it can be useful to compare firmware compatibility levels. Print
it out with the rest of the version info, if it is contained in the
soft-version partition.
Signed-off-by: Sander Vanheule <sander@svanheule.net>
printf("Version: %d.%d.%d\n", s->version_major, s->version_minor, s->version_patch);
printf("Date: %02x%02x-%02x-%02x\n", s->year_hi, s->year_lo, s->month, s->day);
printf("Revision: %d\n", ntohl(s->rev));
+
+ if (data_len >= offsetof(struct soft_version, compat_level)) {
+ printf("Compatibility level: %d\n", ntohl(s->compat_level));
+ }
} else {
printf("Failed to parse data\n");
}