{"schema":"libjg2-1",
"vpath":"/git/",
"avatar":"/git/avatar/",
"alang":"",
"gen_ut":1754159686,
"reponame":"libwebsockets",
"desc":"libwebsockets lightweight C networking library",
"owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://libwebsockets.org/repo/libwebsockets",
"f":3,
"items": [
{"schema":"libjg2-1",
"cid":"12be9f0a1f0ec291c634400318213350",
"commit": {"type":"commit",
"time": 1705136035,
"time_ofs": 0,
"oid_tree": { "oid": "a8f6a428d24e2a58437fcdd9cb4258bb6b0ee023", "alias": []},
"oid":{ "oid": "49bfef2ecd51b854b63e35d913849b6bb518a7f6", "alias": []},
"msg": "wol: portability",
"sig_commit": { "git_time": { "time": 1705136035, "offset": 0 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },
"sig_author": { "git_time": { "time": 1705135993, "offset": 0 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }},
"body": "wol: portability\n\nhttps://github.com/warmcat/libwebsockets/issues/3048\n"
,
"diff": "diff --git a/include/libwebsockets.h b/include/libwebsockets.h\nindex 379afc8..f2c813b 100644\n--- a/include/libwebsockets.h\n+++ b/include/libwebsockets.h\n@@ -47,6 +47,7 @@ extern \u0022C\u0022 {\n #if defined(_WIN32) \u0026\u0026 !defined(ETHER_ADDR_LEN)\n #define ETHER_ADDR_LEN 6\n #endif\n+#define LWS_ETHER_ADDR_LEN ETHER_ADDR_LEN\n \n #include \u003cstddef.h\u003e\n #include \u003cstring.h\u003e\ndiff --git a/lib/core-net/wol.c b/lib/core-net/wol.c\nindex ae0b037..8edada9 100644\n--- a/lib/core-net/wol.c\n+++ b/lib/core-net/wol.c\n@@ -57,9 +57,9 @@ lws_wol(struct lws_context *ctx, const char *ip_or_NULL, uint8_t *mac_6_bytes)\n addr.sin_family \u003d AF_INET;\n addr.sin_port \u003d htons(9);\n \n- if (!inet_aton(ip_or_NULL ? ip_or_NULL : \u0022255.255.255.255\u0022,\n- \u0026addr.sin_addr)) {\n- lwsl_cx_err(ctx, \u0022failed to convert broadcast ads, errno %d\u005cn\u0022,\n+\tif (!inet_pton(AF_INET, ip_or_NULL ? ip_or_NULL : \u0022255.255.255.255\u0022,\n+\t\t\t\t \u0026addr.sin_addr)) {\n+ lwsl_cx_err(ctx, \u0022failed to convert to ipv4 broadcast ads, errno %d\u005cn\u0022,\n errno);\n goto bail;\n }\n@@ -68,7 +68,8 @@ lws_wol(struct lws_context *ctx, const char *ip_or_NULL, uint8_t *mac_6_bytes)\n mac_6_bytes[0], mac_6_bytes[1], mac_6_bytes[2], mac_6_bytes[3],\n mac_6_bytes[4], mac_6_bytes[5], ip_or_NULL ? ip_or_NULL : \u0022\u0022);\n \n- if (sendto(fd, pkt, sizeof(pkt), 0, (struct sockaddr *)\u0026addr,\n+\t/* arg2 is normally const void *, on mingw it's const char * */\n+ if (sendto(fd, (const char *)pkt, sizeof(pkt), 0, (struct sockaddr *)\u0026addr,\n sizeof(addr)) \u003c 0) {\n lwsl_cx_err(ctx, \u0022failed to sendto broadcast ads, errno %d\u005cn\u0022,\n errno);\ndiff --git a/minimal-examples-lowlevel/raw/minimal-raw-wol/minimal-raw-wol.c b/minimal-examples-lowlevel/raw/minimal-raw-wol/minimal-raw-wol.c\nindex 8a9eca6..a2f8b79 100644\n--- a/minimal-examples-lowlevel/raw/minimal-raw-wol/minimal-raw-wol.c\n+++ b/minimal-examples-lowlevel/raw/minimal-raw-wol/minimal-raw-wol.c\n@@ -10,14 +10,13 @@\n */\n \n #include \u003clibwebsockets.h\u003e\n-#include \u003cnet/if.h\u003e\n \n int main(int argc, const char **argv)\n {\n struct lws_context_creation_info info;\n struct lws_context *ctx;\n const char *p, *ip \u003d NULL;\n- uint8_t mac[ETHER_ADDR_LEN];\n+ uint8_t mac[LWS_ETHER_ADDR_LEN];\n int ret \u003d 1;\n \n \tmemset(\u0026info, 0, sizeof info);\n","s":{"c":1754159686,"u": 7249}}
],"g": 8760,"chitpc": 0,"ehitpc": 0,"indexed":0
,
"ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}