Skip to content
Snippets Groups Projects
Commit a6f0a03c authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Merge branch 'nkupdates' into 'main'

chore: updated to version 7.0.1

See merge request !46
parents 4d93befe e2463041
No related branches found
No related tags found
1 merge request!46chore: updated to version 7.0.1
......@@ -25,7 +25,7 @@ FROM registry.conarx.tech/containers/nginx-php/3.20 as builder
# UPDATE timescaledb version in tests/docker-compose.yml.timescaledb.tmpl to the max supported version
# ref https://hub.docker.com/repository/docker/allworldit/postgresql-timescaledb/tags?page=1&ordering=last_updated
# ref https://github.com/zabbix/zabbix/blob/6e6aa6c5a866e56648410275a936959a5100712c/include/zbx_dbversion_constants.h#L62
ENV ZABBIX_VER=7.0.0
ENV ZABBIX_VER=7.0.1
COPY patches /build/patches
......@@ -71,7 +71,6 @@ RUN set -eux; \
patch -p1 < ../patches/zabbix-disable-chrome-sandboxing.patch; \
patch -p1 < ../patches/zabbix-6.4.4_cgoflags-append-fix.patch; \
# Alpine patches
patch -p1 < ../patches/fix-msghdr.patch; \
patch -p1 < ../patches/ui-services-fix-php-80.patch; \
true "Configuring"; \
autoreconf -fvi; \
......
musl has padding on struct msghdr fields so the designated initialiser fails with int-conversion:
src/libs/zbxsysinfo/linux/net.c:115:95: error: initialization of 'int' from 'void *' makes integer from pointer without a cast [-Werror=int-conversion]
115 | struct msghdr s_msg = { (void *)&s_sa, sizeof(struct sockaddr_nl), s_io, 1, NULL, 0, 0};
this is because the assignment becomes to padding, and the resulting struct is broken
diff --git a/src/libs/zbxsysinfo/linux/net.c b/src/libs/zbxsysinfo/linux/net.c
index 4b0a634..1ccc2c4 100644
--- a/src/libs/zbxsysinfo/linux/net.c
+++ b/src/libs/zbxsysinfo/linux/net.c
@@ -112,13 +112,27 @@ static int find_tcp_port_by_state_nl(unsigned short port, int state, int *found)
struct sockaddr_nl s_sa = { AF_NETLINK, 0, 0, 0 };
struct iovec s_io[1] = { { &request, sizeof(request) } };
- struct msghdr s_msg = { (void *)&s_sa, sizeof(struct sockaddr_nl), s_io, 1, NULL, 0, 0};
+ struct msghdr s_msg;
+ s_msg.msg_name = (void *)&s_sa;
+ s_msg.msg_namelen = sizeof(struct sockaddr_nl);
+ s_msg.msg_iov = s_io;
+ s_msg.msg_iovlen = 1;
+ s_msg.msg_control = NULL;
+ s_msg.msg_controllen = 0;
+ s_msg.msg_flags = 0;
char buffer[BUFSIZ] = { 0 };
struct sockaddr_nl r_sa = { AF_NETLINK, 0, 0, 0 };
struct iovec r_io[1] = { { buffer, BUFSIZ } };
- struct msghdr r_msg = { (void *)&r_sa, sizeof(struct sockaddr_nl), r_io, 1, NULL, 0, 0};
+ struct msghdr r_msg;
+ r_msg.msg_name = (void *)&r_sa;
+ r_msg.msg_namelen = sizeof(struct sockaddr_nl);
+ r_msg.msg_iov = r_io;
+ r_msg.msg_iovlen = 1;
+ r_msg.msg_control = NULL;
+ r_msg.msg_controllen = 0;
+ r_msg.msg_flags = 0;
struct nlmsghdr *r_hdr;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment