Set sa_len field in DHCP relay code.

Ommision broke DHCP relay on *BSD.
This commit is contained in:
Simon Kelley
2024-12-03 21:22:21 +00:00
parent 6c9bc0156a
commit 5a1f2c577d
2 changed files with 7 additions and 1 deletions

View File

@@ -1125,6 +1125,9 @@ static int relay_upstream4(int iface_index, struct dhcp_packet *mess, size_t sz)
to.sa.sa_family = AF_INET;
to.in.sin_addr = relay->server.addr4;
to.in.sin_port = htons(relay->port);
#ifdef HAVE_SOCKADDR_SA_LEN
to.in.sin_len = sizeof(struct sockaddr_in);
#endif
/* Broadcasting to server. */
if (relay->server.addr4.s_addr == 0)