if (blob_raw_len(hdr->data) < sizeof(*hdr->data))
return false;
- if (blob_raw_len(hdr->data) + sizeof(*hdr) > UBUS_MAX_MSGLEN)
+ if (blob_pad_len(hdr->data) > UBUS_MAX_MSGLEN)
return false;
return true;
struct {
struct ubus_msghdr hdr;
- char data[UBUS_MAX_MSGLEN - sizeof(struct ubus_msghdr)];
+ char data[UBUS_MAX_MSGLEN];
} msgbuf;
};
if (cl->pending_msg_offset < sizeof(cl->hdrbuf))
goto out;
- if (blob_len(&cl->hdrbuf.data) + sizeof(cl->hdrbuf) > UBUS_MAX_MSGLEN)
+ if (blob_pad_len(&cl->hdrbuf.data) > UBUS_MAX_MSGLEN)
goto disconnect;
cl->pending_msg = ubus_msg_new(NULL, blob_raw_len(&cl->hdrbuf.data), false);
#define __packetdata __attribute__((packed)) __attribute__((__aligned__(4)))
-#define UBUS_MAX_MSGLEN 65535
+#define UBUS_MAX_MSGLEN 65536
#define UBUS_SYSTEM_OBJECT_EVENT 1
#define UBUS_SYSTEM_OBJECT_MAX 1024