Skip to content

Commit 8088fce

Browse files
committed
Merge branch 'master' of github.com:surban/aggligator
2 parents 1dff8dd + ea84e83 commit 8088fce

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

aggligator-util/src/bin/raw-speed.rs

+15-14
Original file line numberDiff line numberDiff line change
@@ -138,23 +138,24 @@ impl RawClientCli {
138138
{
139139
let mut bound = false;
140140

141-
for ifn in ifaces {
141+
'ifaces: for ifn in ifaces {
142142
if ifn.name.as_bytes() == iface {
143-
let Some(addr) = ifn.addr else { continue };
144-
match (addr.ip(), target.ip()) {
145-
(IpAddr::V4(_), IpAddr::V4(_)) => (),
146-
(IpAddr::V6(_), IpAddr::V6(_)) => (),
147-
_ => continue,
148-
}
143+
for addr in &ifn.addr {
144+
match (addr.ip(), target.ip()) {
145+
(IpAddr::V4(_), IpAddr::V4(_)) => (),
146+
(IpAddr::V6(_), IpAddr::V6(_)) => (),
147+
_ => continue,
148+
}
149149

150-
if addr.ip().is_loopback() != target.ip().is_loopback() {
151-
continue;
152-
}
150+
if addr.ip().is_loopback() != target.ip().is_loopback() {
151+
continue;
152+
}
153153

154-
tracing::debug!("binding to {addr:?} on interface {}", &ifn.name);
155-
socket.bind(SocketAddr::new(addr.ip(), 0))?;
156-
bound = true;
157-
break;
154+
tracing::debug!("binding to {addr:?} on interface {}", &ifn.name);
155+
socket.bind(SocketAddr::new(addr.ip(), 0))?;
156+
bound = true;
157+
break 'ifaces;
158+
}
158159
}
159160
}
160161

0 commit comments

Comments
 (0)