]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Pad after end
authorRoy Marples <roy@marples.name>
Thu, 12 Jul 2007 06:57:21 +0000 (06:57 +0000)
committerRoy Marples <roy@marples.name>
Thu, 12 Jul 2007 06:57:21 +0000 (06:57 +0000)
dhcp.c

diff --git a/dhcp.c b/dhcp.c
index 9f45d94ba1cf917ec3c0062eea4cc426ebba6e92..d6dde73a3100fea518e25375a545a6a7fcd8284c 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -275,14 +275,15 @@ size_t send_message (const interface_t *iface, const dhcp_t *dhcp,
                p += iface->hwlen;
        }
 
+       *p++ = DHCP_END;
+
 #ifdef BOOTP_MESSAGE_LENTH_MIN
        /* Some crappy DHCP servers think they have to obey the BOOTP minimum
         * messag length. They are wrong, but we should still cater for them */
-       while (p - m < BOOTP_MESSAGE_LENTH_MIN - 1)
+       while (p - m < BOOTP_MESSAGE_LENTH_MIN)
                *p++ = DHCP_PAD;
 #endif
 
-       *p++ = DHCP_END;
        message_length = p - m;
 
        memset (&packet, 0, sizeof (struct udp_dhcp_packet));