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

@@ -51,6 +51,9 @@ version 2.91
so 1234:: becomes
1234-0000-0000-0000-0000-0000-0000-0000.example.com
Fix broken dhcp-relay on *BSD. Thanks to Harold for finding
this problem.
version 2.90
Fix reversion in --rev-server introduced in 2.88 which

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)