Skip to content

Commit d26dac5

Browse files
committed
rip: handle errors when setting the SO_BINDTODEVICE sockoption
Shit happens... no need to panic! :) Signed-off-by: Renato Westphal <[email protected]>
1 parent d47c43d commit d26dac5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

holo-rip/src/ripng/network.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl NetworkVersion for Ripng {
3535
SocketAddr::from((Ipv6Addr::UNSPECIFIED, Self::UDP_PORT));
3636
let socket =
3737
capabilities::raise(|| UdpSocket::bind_reuseaddr(sockaddr))?;
38-
socket.bind_device(Some(ifname.as_bytes())).unwrap();
38+
socket.bind_device(Some(ifname.as_bytes()))?;
3939
socket.set_multicast_loop_v6(false)?;
4040
socket.set_ipv6_tclass(libc::IPTOS_PREC_INTERNETCONTROL)?;
4141

holo-rip/src/ripv2/network.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl NetworkVersion for Ripv2 {
3535
SocketAddr::from((Ipv4Addr::UNSPECIFIED, Self::UDP_PORT));
3636
let socket =
3737
capabilities::raise(|| UdpSocket::bind_reuseaddr(sockaddr))?;
38-
socket.bind_device(Some(ifname.as_bytes())).unwrap();
38+
socket.bind_device(Some(ifname.as_bytes()))?;
3939
socket.set_multicast_loop_v4(false)?;
4040
socket.set_multicast_ttl_v4(1)?;
4141
socket.set_ipv4_tos(libc::IPTOS_PREC_INTERNETCONTROL)?;

0 commit comments

Comments
 (0)