Skip to content
Snippets Groups Projects
Commit fd7cbd0c authored by Benoît Canet's avatar Benoît Canet Committed by Glauber Costa
Browse files

dhcp: Remove double htonl conversion.


After 5f0e9733 htonl was called twice: once before calling
dhcp_mbuf::compose_request and once more inside this function.
Fix this, verified on wire packets with wireshark and audited code.

Signed-off-by: default avatarBenoit Canet <benoit@irqsave.net>
Signed-off-by: default avatarGlauber Costa <glommer@cloudius-systems.com>
parent 5a080419
No related branches found
No related tags found
No related merge requests found
......@@ -209,7 +209,7 @@ namespace dhcp {
memcpy(options, dhcp_options_magic, 4);
options += 4;
in_addr_t dhcp_server_ip = htonl(sip);
in_addr_t dhcp_server_ip = sip;
in_addr_t requested_ip = yip;
options = add_option(options, DHCP_OPTION_MESSAGE_TYPE, 1, DHCP_MT_REQUEST);
options = add_option(options, DHCP_OPTION_DHCP_SERVER, 4, (u8*)&dhcp_server_ip);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment