Use pico_rand for DHCP xid, run cmake in load command
This commit is contained in:
3
dhcp.cpp
3
dhcp.cpp
@@ -1,5 +1,6 @@
|
||||
#include "dhcp.h"
|
||||
#include <span>
|
||||
#include "pico/rand.h"
|
||||
#include "w6300.h"
|
||||
|
||||
namespace dhcp_opt {
|
||||
@@ -15,7 +16,7 @@ struct __attribute__((packed)) dhcp_discover {
|
||||
uint8_t htype = 1;
|
||||
uint8_t hlen = 6;
|
||||
uint8_t hops = 0;
|
||||
uint32_t xid = __builtin_bswap32(0x12345678);
|
||||
uint32_t xid = __builtin_bswap32(static_cast<uint32_t>(get_rand_64()));
|
||||
uint16_t secs = 0;
|
||||
uint16_t flags = __builtin_bswap16(0x8000);
|
||||
std::array<uint8_t, 4> ciaddr = {};
|
||||
|
||||
Reference in New Issue
Block a user