diff options
author | Tom Gundersen <teg@jklm.no> | 2014-02-23 22:07:07 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-02-23 23:00:18 +0100 |
commit | 0a1b6da82109c3b08b1f966a1625a77cc312135a (patch) | |
tree | 5a0d4f60de3dbe8adffc4c46511393a35e038a28 /src/libsystemd-dhcp/dhcp-packet.c | |
parent | 8fa2eeace7beecedb01c82811e28949cacec1236 (diff) |
sd-dhcp: message_init - only set secs in the client
Diffstat (limited to 'src/libsystemd-dhcp/dhcp-packet.c')
-rw-r--r-- | src/libsystemd-dhcp/dhcp-packet.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/libsystemd-dhcp/dhcp-packet.c b/src/libsystemd-dhcp/dhcp-packet.c index 13881ea0dd..1937de4252 100644 --- a/src/libsystemd-dhcp/dhcp-packet.c +++ b/src/libsystemd-dhcp/dhcp-packet.c @@ -37,10 +37,11 @@ #define DHCP_CLIENT_MIN_OPTIONS_SIZE 312 int dhcp_message_init(DHCPMessage *message, uint8_t op, uint32_t xid, - uint8_t type, uint16_t secs, uint8_t **opt, - size_t *optlen) { + uint8_t type, uint8_t **opt, size_t *optlen) { int err; + assert(op == BOOTREQUEST || op == BOOTREPLY); + *opt = (uint8_t *)(message + 1); if (*optlen < 4) @@ -52,10 +53,6 @@ int dhcp_message_init(DHCPMessage *message, uint8_t op, uint32_t xid, message->hlen = ETHER_ADDR_LEN; message->xid = htobe32(xid); - /* Although 'secs' field is a SHOULD in RFC 2131, certain DHCP servers - refuse to issue an DHCP lease if 'secs' is set to zero */ - message->secs = htobe16(secs); - (*opt)[0] = 0x63; (*opt)[1] = 0x82; (*opt)[2] = 0x53; |