Skip to content

Commit 6d5055d

Browse files
test: Use built-in hton to avoid macro conflict on mac OS
1 parent da893aa commit 6d5055d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

test/net/unit/dhcp_message_test.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,17 @@ struct test_opt
3232
// Creates a DHCP DISCOVERY message on the buffer
3333
net::dhcp::Message* create_discovery_msg(uint8_t* buffer)
3434
{
35+
using namespace net;
3536
using namespace net::dhcp;
3637
auto* msg = reinterpret_cast<Message*>(buffer);
3738

3839
msg->op = static_cast<uint8_t>(op_code::BOOTREQUEST);
3940
msg->htype = static_cast<uint8_t>(htype::ETHER);
4041
msg->hlen = ETH_ALEN;
4142
msg->hops = 0;
42-
msg->xid = net::htonl(322420);
43+
msg->xid = htonl(322420);
4344
msg->secs = 0;
44-
msg->flags = net::htons(static_cast<uint16_t>(flag::BOOTP_BROADCAST));
45+
msg->flags = htons(static_cast<uint16_t>(flag::BOOTP_BROADCAST));
4546
msg->ciaddr = 0;
4647
msg->yiaddr = 0;
4748
msg->siaddr = 0;

0 commit comments

Comments
 (0)