Aurélien Aptel <aaptel@xxxxxxxx> wrote: > > struct address { > > union { > > struct sockaddr_in sin; > > struct sockaddr_in6 sin6; > > }; > > }; > > You probably want struct sockaddr_storage here. It's actually now: struct address { u8 family; union { struct sockaddr_in sin; struct sockaddr_in6 sin6; }; }; And note that this is schematic not actual. It's not actually a C union. ipv4 and ipv6 addresses take up different amounts of space in the binary blob. One of the criteria is that the blob should be as small as possible since it gets cached by the kernel as is (as the payload of a key) and only gets looked at when it gets parsed. David