linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: =?utf-8?Q?Aur=C3=A9lien?= Aptel <aaptel@suse.com>
Cc: dhowells@redhat.com, trond.myklebust@hammerspace.com,
	anna.schumaker@netapp.com, sfrench@samba.org,
	linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org,
	linux-afs@lists.infradead.org, linux-fsdevel@vger.kernel.org
Subject: Re: Making the in-kernel DNS resolver handle server lists
Date: Thu, 13 Sep 2018 21:01:26 +0100	[thread overview]
Message-ID: <5805.1536868886@warthog.procyon.org.uk> (raw)
In-Reply-To: <87lg854ws2.fsf@suse.com>

Aurélien Aptel <aaptel@suse.com> 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

      parent reply	other threads:[~2018-09-14  1:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-12 11:11 Making the in-kernel DNS resolver handle server lists David Howells
2018-09-12 20:53 ` Steve French
2018-09-12 21:18 ` David Howells
2018-09-12 22:27   ` Steve French
2018-09-13  8:38 ` Aurélien Aptel
2018-09-13 18:30   ` Steve French
2018-09-13  9:14 ` David Howells
2018-09-13 20:01 ` David Howells [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5805.1536868886@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=aaptel@suse.com \
    --cc=anna.schumaker@netapp.com \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=sfrench@samba.org \
    --cc=trond.myklebust@hammerspace.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).