mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-09-01 14:55:30 +00:00
Don't unicast to client if broadcast is requested
This commit is contained in:
8
dhcp.c
8
dhcp.c
@@ -778,9 +778,11 @@ void ack_lease (packet, lease, offer, when)
|
|||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* If it comes from a client who already knows its address,
|
/* If it comes from a client who already knows its address and
|
||||||
sent it directly to that client. */
|
is not requesting a broadcast response, sent it directly to
|
||||||
} else if (raw.ciaddr.s_addr && offer == DHCPACK) {
|
that client. */
|
||||||
|
} else if (raw.ciaddr.s_addr && offer == DHCPACK &&
|
||||||
|
!(raw.flags & BOOTP_BROADCAST)) {
|
||||||
to.sin_addr = packet -> raw -> ciaddr;
|
to.sin_addr = packet -> raw -> ciaddr;
|
||||||
to.sin_port = htons (ntohs (server_port) + 1); /* XXX */
|
to.sin_port = htons (ntohs (server_port) + 1); /* XXX */
|
||||||
|
|
||||||
|
@@ -778,9 +778,11 @@ void ack_lease (packet, lease, offer, when)
|
|||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* If it comes from a client who already knows its address,
|
/* If it comes from a client who already knows its address and
|
||||||
sent it directly to that client. */
|
is not requesting a broadcast response, sent it directly to
|
||||||
} else if (raw.ciaddr.s_addr && offer == DHCPACK) {
|
that client. */
|
||||||
|
} else if (raw.ciaddr.s_addr && offer == DHCPACK &&
|
||||||
|
!(raw.flags & BOOTP_BROADCAST)) {
|
||||||
to.sin_addr = packet -> raw -> ciaddr;
|
to.sin_addr = packet -> raw -> ciaddr;
|
||||||
to.sin_port = htons (ntohs (server_port) + 1); /* XXX */
|
to.sin_port = htons (ntohs (server_port) + 1); /* XXX */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user