sd-dhcp6-client: append extra options before elapsed time option
The value of elapsed time option is determined in runtime and not deterministic. It is hard to test the sent packets if it is located in the intermidiate of the packet.
This commit is contained in:
@@ -726,6 +726,12 @@ static int client_send_message(sd_dhcp6_client *client) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
ORDERED_HASHMAP_FOREACH(j, client->extra_options) {
|
||||
r = dhcp6_option_append(&opt, &optlen, j->option, j->length, j->data);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
/* RFC 8415 Section 21.9.
|
||||
* A client MUST include an Elapsed Time option in messages to indicate how long the client has
|
||||
* been trying to complete a DHCP message exchange. */
|
||||
@@ -735,12 +741,6 @@ static int client_send_message(sd_dhcp6_client *client) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
ORDERED_HASHMAP_FOREACH(j, client->extra_options) {
|
||||
r = dhcp6_option_append(&opt, &optlen, j->option, j->length, j->data);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
r = dhcp6_network_send_udp_socket(client->fd, &all_servers, message,
|
||||
len - optlen);
|
||||
if (r < 0)
|
||||
|
||||
Reference in New Issue
Block a user