udp: remove extra socket iteration in virtual iface

This commit is contained in:
Aram 🍐 2022-01-10 00:46:52 -05:00
parent 782f5e74bf
commit 47c6c588d2

View file

@ -134,7 +134,6 @@ impl VirtualInterfacePoll for UdpVirtualInterface {
_ => {} _ => {}
} }
// Find client socket send data to
for (virtual_port, client_handle) in port_client_handle_map.iter() { for (virtual_port, client_handle) in port_client_handle_map.iter() {
let client_socket = iface.get_socket::<UdpSocket>(*client_handle); let client_socket = iface.get_socket::<UdpSocket>(*client_handle);
if client_socket.can_send() { if client_socket.can_send() {
@ -155,11 +154,6 @@ impl VirtualInterfacePoll for UdpVirtualInterface {
} }
} }
} }
}
// Find client socket recv data from
for (virtual_port, client_handle) in port_client_handle_map.iter() {
let client_socket = iface.get_socket::<UdpSocket>(*client_handle);
if client_socket.can_recv() { if client_socket.can_recv() {
match client_socket.recv() { match client_socket.recv() {
Ok((data, _peer)) => { Ok((data, _peer)) => {