diff options
author | Ted Lemon <source@isc.org> | 1996-06-24 20:32:12 +0000 |
---|---|---|
committer | Ted Lemon <source@isc.org> | 1996-06-24 20:32:12 +0000 |
commit | 8ec97099c11e23f72abfb781edb95cb6d5a86842 (patch) | |
tree | f7e0891fc2e8c2caf8e63caad282af46a202748e | |
parent | b8b8bc8e37fe21d77ae899df7fa52000c0f577e9 (diff) | |
download | isc-dhcp-8ec97099c11e23f72abfb781edb95cb6d5a86842.tar.gz |
Ensure that dhcp packets are at least BOOTP_MIN_LEN bytes long when sending through gateways
-rw-r--r-- | dhcp.c | 9 | ||||
-rw-r--r-- | server/dhcp.c | 9 |
2 files changed, 18 insertions, 0 deletions
@@ -402,6 +402,9 @@ void nak_lease (packet, cip) to.sin_addr = raw.giaddr; to.sin_port = server_port; + if (outgoing.packet_length < BOOTP_MIN_LEN) + outgoing.packet_length = BOOTP_MIN_LEN; + #ifdef USE_FALLBACK result = send_fallback (&fallback_interface, packet, &raw, outgoing.packet_length, @@ -717,6 +720,8 @@ void ack_lease (packet, lease, offer, when) } cons_options (packet, &outgoing, options, bufs); + if (!offer && outgoing.packet_length < BOOTP_MIN_LEN) + outgoing.packet_length = BOOTP_MIN_LEN; raw.ciaddr = packet -> raw -> ciaddr; memcpy (&raw.yiaddr, lease -> ip_addr.iabuf, 4); @@ -769,6 +774,10 @@ void ack_lease (packet, lease, offer, when) if (raw.giaddr.s_addr) { to.sin_addr = raw.giaddr; to.sin_port = server_port; + + if (outgoing.packet_length < BOOTP_MIN_LEN) + outgoing.packet_length = BOOTP_MIN_LEN; + #ifdef USE_FALLBACK result = send_fallback (&fallback_interface, packet, &raw, outgoing.packet_length, diff --git a/server/dhcp.c b/server/dhcp.c index 3b8cc52d..0ccc435f 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -402,6 +402,9 @@ void nak_lease (packet, cip) to.sin_addr = raw.giaddr; to.sin_port = server_port; + if (outgoing.packet_length < BOOTP_MIN_LEN) + outgoing.packet_length = BOOTP_MIN_LEN; + #ifdef USE_FALLBACK result = send_fallback (&fallback_interface, packet, &raw, outgoing.packet_length, @@ -717,6 +720,8 @@ void ack_lease (packet, lease, offer, when) } cons_options (packet, &outgoing, options, bufs); + if (!offer && outgoing.packet_length < BOOTP_MIN_LEN) + outgoing.packet_length = BOOTP_MIN_LEN; raw.ciaddr = packet -> raw -> ciaddr; memcpy (&raw.yiaddr, lease -> ip_addr.iabuf, 4); @@ -769,6 +774,10 @@ void ack_lease (packet, lease, offer, when) if (raw.giaddr.s_addr) { to.sin_addr = raw.giaddr; to.sin_port = server_port; + + if (outgoing.packet_length < BOOTP_MIN_LEN) + outgoing.packet_length = BOOTP_MIN_LEN; + #ifdef USE_FALLBACK result = send_fallback (&fallback_interface, packet, &raw, outgoing.packet_length, |