Skip to content

Commit

Permalink
log and drop ipv6 packets requiring fragmentation
Browse files Browse the repository at this point in the history
ipv6 -> IPv6

Co-authored-by: Catherine <whitequark@whitequark.org>
  • Loading branch information
Easyoakland and whitequark committed Jan 29, 2025
1 parent 49cc60a commit bef9b05
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions src/iface/interface/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1299,16 +1299,24 @@ impl InterfaceInner {
}
// We don't support IPv6 fragmentation yet.
#[cfg(feature = "proto-ipv6")]
IpRepr::Ipv6(_) => tx_token.consume(total_len, |mut tx_buffer| {
#[cfg(feature = "medium-ethernet")]
if matches!(self.caps.medium, Medium::Ethernet) {
emit_ethernet(&ip_repr, tx_buffer)?;
tx_buffer = &mut tx_buffer[EthernetFrame::<&[u8]>::header_len()..];
}
IpRepr::Ipv6(_) => {
// Check if we need to fragment it.
if total_ip_len > self.caps.ip_mtu() {
net_debug!("IPv6 fragmentation support is unimplemented. Dropping.");
Ok(())
} else {
tx_token.consume(total_len, |mut tx_buffer| {
#[cfg(feature = "medium-ethernet")]
if matches!(self.caps.medium, Medium::Ethernet) {
emit_ethernet(&ip_repr, tx_buffer)?;
tx_buffer = &mut tx_buffer[EthernetFrame::<&[u8]>::header_len()..];
}

emit_ip(&ip_repr, tx_buffer);
Ok(())
}),
emit_ip(&ip_repr, tx_buffer);
Ok(())
})
}
}
}
}
}
Expand Down

0 comments on commit bef9b05

Please sign in to comment.