On Monday, 21 February 2022 10:14:18 CET Sven Eckelmann wrote:
On Sunday, 20 February 2022 19:36:14 CET Marek Lindner wrote:
diff --git a/alfred.h b/alfred.h index 9ab92a2..598d38b 100644 --- a/alfred.h +++ b/alfred.h @@ -33,6 +33,9 @@ #define FIXED_TLV_LEN(__tlv_type) \ htons(sizeof(__tlv_type) - sizeof(__tlv_type.header))
+#define FIXED_TLV_LEN_PTR(__tlv_type) \
htons(sizeof(*__tlv_type) - sizeof(__tlv_type->header))
This doesn't apply on master. And also doesn't make a lot of sense, because you can now just use FIXED_TLV_LEN(*whatever). So I have dropped this part and applied the rest.
Your proposal did no compile and the master branch now also does not compile on ipq40xx:
unix_sock.c: In function 'unix_sock_server_status': alfred.h:34:46: error: 'status_op_mode' is a pointer; did you mean to use '->'? htons(sizeof(__tlv_type) - sizeof(__tlv_type.header))
Btw. good that you've spotted some prints to stderr which should actually be to stdout. You only missed it for "mode: unknown".
The alfred server running not in primary and not in secondary mode was stderr worthy for me. But I also don't feel strongly about this.
Cheers, Marek