From 145be13e8c18fcb39476d8f65fed23d82320f22f Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Mon, 5 Jan 2026 00:03:17 +0100 Subject: ipcpd: Initialize mgmt frames in eth/udp The eth and udp layer management frames/packets contain some unused fields which were not cleared after malloc. In a future update, the unused fields will be removed from the packets, but for now, we can just zero these after malloc. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/udp/udp.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ipcpd/udp') diff --git a/src/ipcpd/udp/udp.c b/src/ipcpd/udp/udp.c index be8069a4..d8b5b4cd 100644 --- a/src/ipcpd/udp/udp.c +++ b/src/ipcpd/udp/udp.c @@ -208,6 +208,8 @@ static int udp_ipcp_port_alloc(const struct __SOCKADDR * r_saddr, if (buf == NULL) return -1; + memset(buf, 0, len + data->len); + msg = (struct mgmt_msg *) buf; msg->eid = hton32(MGMT_EID); msg->code = FLOW_REQ; @@ -251,6 +253,8 @@ static int udp_ipcp_port_alloc_resp(const struct __SOCKADDR * r_saddr, if (msg == NULL) return -1; + memset(msg, 0, sizeof(*msg) + data->len); + msg->eid = hton32(MGMT_EID); msg->code = FLOW_REPLY; msg->s_eid = hton32(s_eid); -- cgit v1.2.3