Skip to content

Socketpair fixes - #876

Merged
raphael-proust merged 3 commits into
ocsigen:masterfrom
raphael-proust:socketpair-fixes
Aug 6, 2021
Merged

raphael-proust merged 3 commits into
ocsigen:masterfrom
raphael-proust:socketpair-fixes

Conversation

@raphael-proust

Copy link
Copy Markdown
Collaborator

The part of #870 that's not dependent on OCaml.4.14.

MisterDA and others added 3 commits August 6, 2021 14:21
Lwt provides an emulation of socketpair on Windows, using PF_INET6
sockets. It has to duplicate the table of Unix.socket_domain. The type
reads as follows:

    type socket_domain =
    | PF_UNIX          (* Unix domain *)
    | PF_INET          (* Internet domain (IPv4) *)
    | PF_INET6         (* Internet domain (IPv6) *)

However, the Lwt `socket_domain_table` has only two entries. If
`socketpair` with PF_INET6 sockets is called, then a value
out-of-bounds of the array will be requested.

Fixed by adding PF_INET6 to the array, thus having the same arity as
the type it's backing.
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

Successfully merging this pull request may close these issues.

2 participants