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

Fix nix on FreeBSD (rebased on master) #397

Merged
merged 3 commits into from
Aug 11, 2016
Merged

Fix nix on FreeBSD (rebased on master) #397

merged 3 commits into from
Aug 11, 2016

Commits on Aug 10, 2016

  1. Configuration menu
    Copy the full SHA
    bae5a37 View commit details
    Browse the repository at this point in the history
  2. Fix the sockopt_impl matcher rule order.

    Rules for generic types were located above rules for specific types, so the
    rules for specific types never got matched.  This caused the
    sys::socket::sockopt::test::can_get_listen_on_tcp_socket test to fail on
    FreeBSD.  The solution is to put all of the generic rules at the bottom.
    asomers authored and fiveop committed Aug 10, 2016
    Configuration menu
    Copy the full SHA
    36789c7 View commit details
    Browse the repository at this point in the history
  3. Fix nix on FreeBSD amd64

    On Linux, the cmsg_len field of struct cmsghdr has type size_t, but it
    has size socklen_t on POSIX-compliant operating systems.  So on
    POSIX-compliant 64-bit operating systems, struct cmsghdr has padding
    gaps that aren't present on Linux.  Most of the issues fixed by this
    commit related to those gaps.
    
    src/sys/socket/ffi.rs
    	Fix the type of the cmsg_data field so the struct layout will be
    	correct.
    
    src/sys/socket/mod.rs
    	In CmsgIterator.next, only return a single file descriptor.
    	sendmsg(2) can only stuff a single file descriptor into each
    	cmsg.
    
    	In cmsg_align, fix the rounding calculation, and eliminate a
    	division instruction.
    
    	Add a missing cmsg_align call in ControlMessage.len
    
    	In ControlMessage.encode_into, add any necessary padding bytes
    	between the cmsghdr and the data.
    
    	In sendmsg, fix some len<->capacity confusion.
    asomers authored and fiveop committed Aug 10, 2016
    Configuration menu
    Copy the full SHA
    077d979 View commit details
    Browse the repository at this point in the history