Skip to content

Commit 4c2fdde

Browse files
committed
uefi
1 parent 5f59b8a commit 4c2fdde

File tree

1 file changed

+5
-10
lines changed
  • uefi-test-runner/src/proto/network

1 file changed

+5
-10
lines changed

uefi-test-runner/src/proto/network/pxe.rs

+5-10
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,11 @@ pub fn test() {
7676

7777
let mut src_ip = server_ip;
7878
let mut src_port = EXAMPLE_SERVICE_PORT;
79-
80-
// TODO add code to put this behind a type
81-
let mut dest_ip = if base_code.mode().using_ipv6() {
82-
IpAddr::V6(Ipv6Addr::from(base_code.mode().station_ip().octets()))
83-
} else {
84-
let octets: [u8; 4] = base_code.mode().station_ip().octets()[0..4]
85-
.try_into()
86-
.unwrap();
87-
IpAddr::V4(Ipv4Addr::from(octets))
88-
};
79+
80+
let mut dest_ip = base_code
81+
.mode()
82+
.station_ip()
83+
.to_ip_addr(base_code.mode().using_ipv6());
8984
let mut dest_port = write_src_port;
9085
let mut header = [0; 1];
9186
let mut received = [0; 4];

0 commit comments

Comments
 (0)