Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Haiku - mismatched socket types #108

Closed
kallisti5 opened this issue Dec 8, 2020 · 3 comments
Closed

Haiku - mismatched socket types #108

kallisti5 opened this issue Dec 8, 2020 · 3 comments

Comments

@kallisti5
Copy link
Contributor

Dag nabbit, I thought we had Haiku support nailed down. Just ran into another net2 error building a crate.

uname -a
Haiku shredder 1 hrev54759 Dec  7 2020 08:38:40 x86_64 x86_64 Haiku
error[E0308]: mismatched types
   --> /boot/home/.cargo/registry/src/github.com-1ecc6299db9ec823/net2-0.2.36/src/socket.rs:121:23
    |
121 |             sin_zero: [0; 8],
    |                       ^^^^^^ expected an array with a fixed size of 24 elements, found one with 8 elements

   Compiling aho-corasick v0.7.15
error[E0063]: missing field `sin_len` in initializer of `libc::sockaddr_in`
   --> /boot/home/.cargo/registry/src/github.com-1ecc6299db9ec823/net2-0.2.36/src/socket.rs:117:13
    |
117 |         v4: c::sockaddr_in {
    |             ^^^^^^^^^^^^^^ missing `sin_len`

error[E0063]: missing field `sin6_len` in initializer of `libc::sockaddr_in6`
   --> /boot/home/.cargo/registry/src/github.com-1ecc6299db9ec823/net2-0.2.36/src/socket.rs:164:13
    |
164 |         v6: c::sockaddr_in6 {
    |             ^^^^^^^^^^^^^^^ missing `sin6_len`

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0063, E0308.
For more information about an error, try `rustc --explain E0063`.
error: could not compile `net2`
@kallisti5
Copy link
Contributor Author

Confirmed on Haiku sin_len and sin6_len don't exist...

/boot/system/develop/headers/posix/netinet/in.h

/* IP Version 4 socket address */
struct sockaddr_in {
    uint8_t     sin_len;
    uint8_t     sin_family;
    uint16_t    sin_port;
    struct in_addr  sin_addr;
    int8_t      sin_zero[24];
};

/boot/system/develop/headers/posix/netinet6/in6.h

/* IP Version 6 socket address. */
struct sockaddr_in6 {
    uint8_t     sin6_len;
    uint8_t     sin6_family;
    uint16_t    sin6_port;
    uint32_t    sin6_flowinfo;
    struct in6_addr sin6_addr;
    uint32_t    sin6_scope_id;
};

Investigating...

@kallisti5
Copy link
Contributor Author

Nevermind, we just need Haiku added for sin_len, sin6_len. Appears ordering of these defines doesn't matter since ordering doesn't match FreeBSD. Working up PR

Pretty sure the expected an array with a fixed size of 24 elements, found one with 8 elements is a bug on our end.. no idea why it's so large.

kallisti5 added a commit to kallisti5/net2-rs that referenced this issue Dec 8, 2020
kallisti5 added a commit to kallisti5/net2-rs that referenced this issue Dec 8, 2020
kallisti5 added a commit to kallisti5/net2-rs that referenced this issue Dec 9, 2020
@pfmooney
Copy link
Member

pfmooney commented Dec 9, 2020

Fixed in 6081dff

@pfmooney pfmooney closed this as completed Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants