You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The latest version published of socket2 (0.3.12) works with the following test program, but when upgrading to latest commit on this repo fails to associate the socket with a multicast address, both on Windows and Linux.
use socket2::{Domain,Protocol,Socket,Type};use std::net::Ipv4Addr;fnmain(){let socket = Socket::new(Domain::IPV4,Type::DGRAM,Some(Protocol::UDP)).expect("could not create socket");
socket
.join_multicast_v4(&Ipv4Addr::new(224,0,0,251),&Ipv4Addr::UNSPECIFIED).expect("could not join multicast group");}
On Windows it crashes as:
Os { code: 10049, kind: AddrNotAvailable, message: "The requested address is not valid in its context." }
On Linux it crashes as:
Os { code: 22, kind: InvalidInput, message: "Invalid argument" }
Running the test program with git bisect led me to the commit on #68, and maybe there is some conversion errors when sending ip addresses to the system calls.
I will try to take a look there at some point, but I thought of warning to avoid a new release before this is fixed.
The text was updated successfully, but these errors were encountered:
bltavares
added a commit
to bltavares/socket2-rs
that referenced
this issue
Jun 25, 2020
This commit changes the byte order when converting IPv4 Addresses, as
the order was reversed.
The test program used to validate it works was sending a multicast
address to `join_multicast_v4` which was not accepted by either Windows
or Linux. Now the test program compiles and run without issues.
```rust
use socket2::{Domain, Protocol, Socket, Type};
use std::net::Ipv4Addr;
fn main() {
let socket = Socket::new(Domain::IPV4, Type::DGRAM, Some(Protocol::UDP))
.expect("could not create socket");
socket
.join_multicast_v4(&Ipv4Addr::new(224, 0, 0, 251), &Ipv4Addr::UNSPECIFIED)
.expect("could not join multicast group");
}
```
Fixesrust-lang#87
This commit changes the byte order when converting IPv4 Addresses, as
the order was reversed.
The test program used to validate it works was sending a multicast
address to `join_multicast_v4` which was not accepted by either Windows
or Linux. Now the test program compiles and run without issues.
```rust
use socket2::{Domain, Protocol, Socket, Type};
use std::net::Ipv4Addr;
fn main() {
let socket = Socket::new(Domain::IPV4, Type::DGRAM, Some(Protocol::UDP))
.expect("could not create socket");
socket
.join_multicast_v4(&Ipv4Addr::new(224, 0, 0, 251), &Ipv4Addr::UNSPECIFIED)
.expect("could not join multicast group");
}
```
Fixes#87
Hi there,
The latest version published of
socket2
(0.3.12
) works with the following test program, but when upgrading to latest commit on this repo fails to associate the socket with a multicast address, both on Windows and Linux.On Windows it crashes as:
On Linux it crashes as:
Running the test program with
git bisect
led me to the commit on #68, and maybe there is some conversion errors when sending ip addresses to the system calls.I will try to take a look there at some point, but I thought of warning to avoid a new release before this is fixed.
The text was updated successfully, but these errors were encountered: