Skip to content

Commit

Permalink
chore: bump socket2 from 0.3.17 to 0.4.1 (solana-labs#19143)
Browse files Browse the repository at this point in the history
* chore: bump socket2 from 0.3.17 to 0.4.1

Bumps [socket2](https://github.com/rust-lang/socket2) from 0.3.17 to 0.4.1.
- [Release notes](https://github.com/rust-lang/socket2/releases)
- [Changelog](https://github.com/rust-lang/socket2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/socket2/commits)

---
updated-dependencies:
- dependency-name: socket2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* [auto-commit] Update all Cargo lock files

* Update to use new consts, From trait

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <[email protected]>
Co-authored-by: Tyera Eulberg <[email protected]>
  • Loading branch information
3 people authored Aug 10, 2021
1 parent 22f8da2 commit 8e1341c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 34 deletions.
16 changes: 2 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion net-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ nix = "0.20.0"
rand = "0.7.0"
serde = "1.0.127"
serde_derive = "1.0.103"
socket2 = "0.3.17"
socket2 = "0.4.1"
solana-clap-utils = { path = "../clap-utils", version = "=1.8.0" }
solana-logger = { path = "../logger", version = "=1.8.0" }
solana-sdk = { path = "../sdk", version = "=1.8.0" }
Expand Down
9 changes: 4 additions & 5 deletions net-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ fn udp_socket(reuseaddr: bool) -> io::Result<Socket> {
use nix::sys::socket::sockopt::{ReuseAddr, ReusePort};
use std::os::unix::io::AsRawFd;

let sock = Socket::new(Domain::ipv4(), Type::dgram(), None)?;
let sock = Socket::new(Domain::IPV4, Type::DGRAM, None)?;
let sock_fd = sock.as_raw_fd();

if reuseaddr {
Expand Down Expand Up @@ -420,7 +420,7 @@ pub fn bind_in_range(ip_addr: IpAddr, range: PortRange) -> io::Result<(u16, UdpS
let addr = SocketAddr::new(ip_addr, port);

if sock.bind(&SockAddr::from(addr)).is_ok() {
let sock = sock.into_udp_socket();
let sock: UdpSocket = sock.into();
return Result::Ok((sock.local_addr().unwrap().port(), sock));
}
}
Expand Down Expand Up @@ -482,8 +482,7 @@ pub fn bind_to(ip_addr: IpAddr, port: u16, reuseaddr: bool) -> io::Result<UdpSoc

let addr = SocketAddr::new(ip_addr, port);

sock.bind(&SockAddr::from(addr))
.map(|_| sock.into_udp_socket())
sock.bind(&SockAddr::from(addr)).map(|_| sock.into())
}

// binds both a UdpSocket and a TcpListener
Expand All @@ -497,7 +496,7 @@ pub fn bind_common(
let addr = SocketAddr::new(ip_addr, port);
let sock_addr = SockAddr::from(addr);
sock.bind(&sock_addr)
.and_then(|_| TcpListener::bind(&addr).map(|listener| (sock.into_udp_socket(), listener)))
.and_then(|_| TcpListener::bind(&addr).map(|listener| (sock.into(), listener)))
}

pub fn find_available_port_in_range(ip_addr: IpAddr, range: PortRange) -> io::Result<u16> {
Expand Down
16 changes: 2 additions & 14 deletions programs/bpf/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8e1341c

Please sign in to comment.