Skip to content

sockaddr_storage in libc is incorrectly defined (on 32 bit systems at least) #23425

@carllerche

Description

@carllerche
Member

I believe that on 32 bit linux, sizeof(struct sockaddr_storage) => 128, in rust => 124. I glanced at the definition in rust and it does look suspect with respect to portability.

Activity

carllerche

carllerche commented on Mar 16, 2015

@carllerche
MemberAuthor

Ok, I believe that the definition should be:

pub struct sockaddr_storage {
   pub ss_family: sa_family_t,
   pub __ss_align: u32,
   pub __ss_pad2: [u8; 120],
}
added a commit that references this issue on Mar 17, 2015
71982c2
added a commit that references this issue on Jan 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @carllerche

      Issue actions

        sockaddr_storage in libc is incorrectly defined (on 32 bit systems at least) · Issue #23425 · rust-lang/rust