The first thing that stuck me was distinguishing the `SSO' part of the union from the rest. It requires the `ssolen' field to align to the later `type' field which isn't guaranteed.
There might also be issues with the `data' field if padding gets introduced.
Having the `type' field (as a uint8_t or char) first would solve this but loses some bits of storage. The other option would be making the type an array of char and bit bashing everything (and memcpy(2) multibyte fields since unaligned accesses aren't universal).
Is it because of bitfields ? Should I rather use a full 64bit data field and mask it to get to my flags ?