Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/target
rust-toolchain
.history
Cargo.lock
*.pcap
1 change: 1 addition & 0 deletions src/iface/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ let iface = InterfaceBuilder::new(device, vec![])
#[derive(Debug, PartialEq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[cfg(feature = "medium-ethernet")]
#[allow(clippy::large_enum_variant)]
enum EthernetPacket<'a> {
#[cfg(feature = "proto-ipv4")]
Arp(ArpRepr),
Expand Down
16 changes: 16 additions & 0 deletions src/socket/dhcpv4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,9 @@ impl Dhcpv4Socket {
let mut dhcp_repr = DhcpRepr {
message_type: DhcpMessageType::Discover,
transaction_id: next_transaction_id,
secs: 0,
sname: None,
boot_file: None,
client_hardware_address: ethernet_addr,
client_ip: Ipv4Address::UNSPECIFIED,
your_ip: Ipv4Address::UNSPECIFIED,
Expand All @@ -420,6 +423,11 @@ impl Dhcpv4Socket {
max_size: Some((cx.caps.ip_mtu() - MAX_IPV4_HEADER_LEN - UDP_HEADER_LEN) as u16),
lease_duration: None,
dns_servers: None,
time_offset: None,
client_arch_list: None,
client_interface_id: None,
client_machine_id: None,
vendor_class_id: None,
};

let udp_repr = UdpRepr {
Expand Down Expand Up @@ -709,6 +717,9 @@ mod test {
const DHCP_DEFAULT: DhcpRepr = DhcpRepr {
message_type: DhcpMessageType::Unknown(99),
transaction_id: TXID,
secs: 0,
sname: None,
boot_file: None,
client_hardware_address: MY_MAC,
client_ip: Ipv4Address::UNSPECIFIED,
your_ip: Ipv4Address::UNSPECIFIED,
Expand All @@ -724,6 +735,11 @@ mod test {
dns_servers: None,
max_size: None,
lease_duration: None,
time_offset: None,
client_arch_list: None,
client_interface_id: None,
client_machine_id: None,
vendor_class_id: None,
};

const DHCP_DISCOVER: DhcpRepr = DhcpRepr {
Expand Down
Loading