From 0b2a19723b07c22363b54d192bc49a4553fa07b5 Mon Sep 17 00:00:00 2001 From: Misha Hawthorn Date: Mon, 24 Aug 2026 09:35:28 -0500 Subject: [PATCH] mksenaofw: warn instead of erroring on plain type-0 images firmware_type 0 ("combo") is currently a fatal error unless a capwap header is supplied. Some rebranded Senao devices ship a plain type-0 header with no capwap section -- notably the Netgear WAX214 and WAX218 (vendor_id 0x231), whose stock web-UI updater accepts the bare 0x60 img_header + magic-XOR'd payload. Downgrade that case to a non-fatal warning. Capwap encodes always set a datecode (-c), so this only affects a type-0 encode with no capwap arguments; encode_image() already omits the capwap section and computes the checksum over the 0x60 header alone when no capwap header is supplied, so a plain image is produced correctly. Signed-off-by: Misha Hawthorn --- src/mksenaofw.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/mksenaofw.c b/src/mksenaofw.c index 172d5f3..2f5fe13 100644 --- a/src/mksenaofw.c +++ b/src/mksenaofw.c @@ -523,10 +523,8 @@ int main(int argc, char *argv[]) } if ((header.firmware_type == 0) && - (cw_header.datecode == DATECODE_NONE)) { - fprintf(stderr, "Firmware type must be non-zero for non-capwap images\n"); - usage(progname, EXIT_FAILURE); - } + (cw_header.datecode == DATECODE_NONE)) + fprintf(stderr, "Warning: firmware type 0 with no capwap header; building a plain image\n"); if (header.vendor_id == 0 || header.product_id == 0) { fprintf(stderr, "Vendor ID and Product ID must be defined and non-zero\n");