From owner-freebsd-bugs@FreeBSD.ORG Mon Jul 21 15:20:48 2014 Return-Path: Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D34C9DDB for ; Mon, 21 Jul 2014 15:20:48 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B42ED2176 for ; Mon, 21 Jul 2014 15:20:48 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LFKmWW047124 for ; Mon, 21 Jul 2014 15:20:48 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 192014] New: getaddrinfo(3) broken in jail on loopback Date: Mon, 21 Jul 2014 15:20:48 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 9.3-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: oleg@mamontov.net X-Bugzilla-Status: Needs Triage X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 15:20:49 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192014 Bug ID: 192014 Summary: getaddrinfo(3) broken in jail on loopback Product: Base System Version: 9.3-RELEASE Hardware: amd64 OS: Any Status: Needs Triage Severity: Affects Many People Priority: --- Component: bin Assignee: freebsd-bugs@FreeBSD.org Reporter: oleg@mamontov.net It seems like https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=190824 broke getaddrinfo in jail with configured only lo0. Real life jail example: [lonerr@tonal ~]% ifconfig re0: flags=8843 metric 0 mtu 1500 options=8209b ether d4:3d:7e:ec:e1:49 media: Ethernet autoselect (1000baseT ) status: active plip0: flags=8810 metric 0 mtu 1500 lo0: flags=8049 metric 0 mtu 16384 options=600003 inet 127.0.1.4 netmask 0xffffffff pflog0: flags=141 metric 0 mtu 33152 After upgrade to 9.3 fetchmail failed to start: fetchmail: 6.3.26 querying google (protocol IMAP) at Mon Jul 21 19:18:03 2014: poll started fetchmail: getaddrinfo("imap.gmail.com","imaps") error: Non-recoverable failure in name resolution Simple test program: [lonerr@tonal ~]% cat gai.c #include #include #include int main() { struct addrinfo hints, *res; int rc; memset(&hints, 0, sizeof(hints)); hints.ai_socktype = SOCK_STREAM; hints.ai_family = AF_UNSPEC; hints.ai_flags |= AI_ADDRCONFIG; printf("rc:%d\n",getaddrinfo("www.freebsd.org", NULL, &hints, &res)); } Run test program on 9.3-RELEASE-p0 with libc.so.7 from base ditribution: [lonerr@tonal ~]% ./gai rc:4 Simple commented out loopback ignoring: [lonerr@tonal ~]% svn di Index: lib/libc/net/getaddrinfo.c =================================================================== --- lib/libc/net/getaddrinfo.c (revision 268939) +++ lib/libc/net/getaddrinfo.c (working copy) @@ -1557,8 +1557,10 @@ if (seen_inet) continue; sin = (struct sockaddr_in *)(ifa->ifa_addr); + /* if (IN_LOOPBACK(htonl(sin->sin_addr.s_addr))) continue; + */ seen_inet = 1; break; #ifdef INET6 Run again after rebuild/reinstall libc.so.7: [lonerr@tonal ~]% ./gai rc:0 -- You are receiving this mail because: You are the assignee for the bug.