We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5f59b8a commit 4c2fddeCopy full SHA for 4c2fdde
uefi-test-runner/src/proto/network/pxe.rs
@@ -76,16 +76,11 @@ pub fn test() {
76
77
let mut src_ip = server_ip;
78
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
- };
+
+ let mut dest_ip = base_code
+ .mode()
+ .station_ip()
+ .to_ip_addr(base_code.mode().using_ipv6());
89
let mut dest_port = write_src_port;
90
let mut header = [0; 1];
91
let mut received = [0; 4];
0 commit comments