From 41fdc8ed32408d598ddafc7feb3beece7f654262 Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Sat, 28 Jan 2023 14:01:37 +0900
Subject: [PATCH] sd-dhcp-server: allow to send header only message

If we receive a header only message, and the server is running in relay
mode, then the assertion was triggered.

Fixes #26151.

(cherry picked from commit b52031dbbcabe4b1e3016ba64d4a2822740188bc)
(cherry picked from commit 7aeb2a8d4ea660ad863e7b2c5432f64f903f1cd5)

Conflict:NA
Reference:https://github.com/systemd/systemd-stable/commit/41fdc8ed32408d598ddafc7feb3beece7f654262
---
 src/libsystemd-network/sd-dhcp-server.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libsystemd-network/sd-dhcp-server.c b/src/libsystemd-network/sd-dhcp-server.c
index 5c9ba9f618..c99f8a86ad 100644
--- a/src/libsystemd-network/sd-dhcp-server.c
+++ b/src/libsystemd-network/sd-dhcp-server.c
@@ -390,7 +390,7 @@ static int dhcp_server_send_udp(sd_dhcp_server *server, be32_t destination,
         assert(server);
         assert(server->fd >= 0);
         assert(message);
-        assert(len > sizeof(DHCPMessage));
+        assert(len >= sizeof(DHCPMessage));
 
         if (server->bind_to_interface) {
                 msg.msg_control = &control;
-- 
2.33.0

