public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "psimerda at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sources.redhat.com
Subject: [Bug libc/2099] Support for SRV records in getaddrinfo
Date: Sun, 29 Jul 2012 22:51:00 -0000	[thread overview]
Message-ID: <bug-2099-131-5KlhwSZpwQ@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-2099-131@http.sourceware.org/bugzilla/>

http://sourceware.org/bugzilla/show_bug.cgi?id=2099

Pavel Šimerda <psimerda at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |psimerda at redhat dot com

--- Comment #8 from Pavel Šimerda <psimerda at redhat dot com> 2012-07-29 22:51:39 UTC ---
I must agree with binki.

> I'm quite sure that when the SRV spec says "domain", it is referring to the
> full domain. Not the domain in the sense of domainname(1). I.e., you would
> search for _someserv._tcp.host1.domain instead of _someserv._tcp.domain. Am I
> misreading the spec here?

Exactly.

You would for example ask for a client XMPP connection, the service is
'xmpp-server' and socktype is SOCK_STREAM (TCP). You are going to connect as
user@example.net, therefore "example.net" is the domain. The getaddrinfo() call
would roughly look like this:

hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_SRVLOOKUP;
code = getaddrinfo("example.net", "xmpp-server", &hints, &result);

This would translate to DNS SRV query for:

_xmpp-server._tcp.example.net

And in absence of such a record, it would fallback to A/AAAA records:

example.net

The way SRV records work is very similar to the way MX records work.

> If the word "domain" in the SRV spec is interpreted properly, this objection
> makes no sense. Sure, it is likely enough that getaddrinfo("domain",
> "someserv", ...) will not tell you to go ahead and connect directly to
> "domain". But getaddrinfo("host1.domain", "someserv", ...) would likely not hit
> any SRV records at all and fall back to the traditional DNS lookups.
> 
> The main objection to this change would be that programs would suddenly break
> if getaddrinfo(node, serv, ...) would suddenly tried to find the appropriate
> host for accessing serv at node. In reality, few domains set SRV records for
> services where there is no program support. So, most programs which would be
> affected by this change would behave no differently if getaddrinfo() started
> actually looking up services instead of just hosts.

That's correct. But still it's probably better to make it optional.

> It would be really nice to get SRV support in applications with no added
> complexity. Maybe the interface provided by ruli
> http://nongnu.org/ruli/tutorial/getaddrinfo.html is a way to get these
> advantages without departing too far from getaddrinfo()...

I've seen this one also.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


  parent reply	other threads:[~2012-07-29 22:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-2099-131@http.sourceware.org/bugzilla/>
2011-01-09 11:08 ` quentusrex at gmail dot com
2011-01-09 23:10 ` quentusrex at gmail dot com
2012-03-20 14:26 ` binki at gentoo dot org
2012-07-29 22:51 ` psimerda at redhat dot com [this message]
2012-11-19 14:52 ` psimerda at redhat dot com
2012-12-18 14:29 ` psimerda at redhat dot com
2012-12-19 23:39 ` bugdal at aerifal dot cx
2014-02-07  2:52 ` [Bug network/2099] " jsm28 at gcc dot gnu.org
2020-12-21  2:45 ` jscott at posteo dot net
2005-12-30 23:26 [Bug libc/2099] New: " fredrik at dolda2000 dot com
2006-01-15 16:28 ` [Bug libc/2099] " aj at suse dot de
2006-01-15 17:15 ` fredrik at dolda2000 dot com
2006-05-03  6:46 ` drepper at redhat dot com
2006-05-06  3:28 ` drepper at redhat dot com

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=bug-2099-131-5KlhwSZpwQ@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sources.redhat.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 read-only IMAP folder(s) and NNTP newsgroup(s).