Skip to content

socket: Initialize so_type in socreate

Nicholas Ngai requested to merge nicholasngai/libslirp:init-so-type into master

This is something I’m thinking while working on !103 (merged). Since we need access to the socket protocol when doing the Unix-to-inet translation, it makes the most sense to me for it to be initialized in the socreate constructor. The type is passed in and used to initialize the so_type field of the struct.

so_type is a uint8_t, which isn’t technically large enough for POSIX’s int type used to represent a socket protocol, but I didn’t want to break state compatibility.

Signed-off-by: Nicholas Ngai nicholas@ngai.me

Merge request reports