From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4744 invoked by alias); 29 Jul 2012 22:51:58 -0000 Received: (qmail 4735 invoked by uid 22791); 29 Jul 2012 22:51:56 -0000 X-SWARE-Spam-Status: No, hits=-3.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 29 Jul 2012 22:51:40 +0000 From: "psimerda at redhat dot com" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: psimerda at redhat dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: drepper.fsp at gmail dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2012-07/txt/msg00259.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=3D2099 Pavel =C5=A0imerda changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |psimerda at redhat dot com --- Comment #8 from Pavel =C5=A0imerda 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 t= he > 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 =3D AF_UNSPEC; hints.ai_socktype =3D SOCK_STREAM; hints.ai_flags =3D AI_SRVLOOKUP; code =3D 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 object= ion > 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 n= ot hit > any SRV records at all and fall back to the traditional DNS lookups. >=20 > The main objection to this change would be that programs would suddenly b= reak > if getaddrinfo(node, serv, ...) would suddenly tried to find the appropri= ate > 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() star= ted > 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. --=20 Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=3Demail ------- You are receiving this mail because: ------- You are on the CC list for the bug.