Re: Making the in-kernel DNS resolver handle server lists

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux