From nobody@FreeBSD.org  Mon Jun 12 01:11:57 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 361FE16A41B
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 12 Jun 2006 01:11:57 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 059A743D48
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 12 Jun 2006 01:11:57 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k5C1BuPf033308
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 12 Jun 2006 01:11:56 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k5C1Bu12033307;
	Mon, 12 Jun 2006 01:11:56 GMT
	(envelope-from nobody)
Message-Id: <200606120111.k5C1Bu12033307@www.freebsd.org>
Date: Mon, 12 Jun 2006 01:11:56 GMT
From: Andrus Nomm <andrus@wask.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: fetch gives error message on ip binding, but binding works
X-Send-Pr-Version: www-2.3

>Number:         98839
>Category:       bin
>Synopsis:       fetch gives error message on ip binding, but binding works
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 12 01:20:05 GMT 2006
>Closed-Date:    Mon Jun 12 20:43:06 GMT 2006
>Last-Modified:  Mon Jun 12 20:43:06 GMT 2006
>Originator:     Andrus Nomm
>Release:        4.11-RELEASE-p10
>Organization:
>Environment:
FreeBSD cell.wask.org 4.11-RELEASE-p10 FreeBSD 4.11-RELEASE-p10 #14: Fri Jun 10 21:40:26 EEST 2005     root@cell.members.ee:/usr/obj/usr/src/sys/MEMBERS  i386

>Description:
While forcing fetch to bind on specific ip (via FETCH_BIND_ADDRESS variable) it always writes "failed".

Same time it binds as requested

Log:
failed to bind to '10.1.1.12'
fetch: ftp://ftp.ee.freebsd.org/pub/FreeBSD/distfiles/libxml2-2.6.26.tar.bz2: File unavailable (e.g., file not found, no access)

Same time ptrace shows:
getsockname(3, {sa_family=AF_INET, sin_port=htons(2355), sin_addr=inet_addr("10.1.1.12")}, [16]) = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 4

>How-To-Repeat:
Set enovriment variable to some ip
try to fetch some file
>Fix:

>Release-Note:
>Audit-Trail:

From: Maxim Konovalov <maxim@macomnet.ru>
To: Andrus Nomm <andrus@wask.org>
Cc: bug-followup@freebsd.org
Subject: Re: bin/98839: fetch gives error message on ip binding, but binding
 works
Date: Mon, 12 Jun 2006 11:31:35 +0400 (MSD)

 > >Description:
 > While forcing fetch to bind on specific ip (via FETCH_BIND_ADDRESS
 > variable) it always writes "failed".
 >
 > Same time it binds as requested
 >
 > Log:
 > failed to bind to '10.1.1.12'
 > fetch: ftp://ftp.ee.freebsd.org/pub/FreeBSD/distfiles/libxml2-2.6.26.tar.bz2: File unavailable (e.g., file not found, no access)
 >
 > Same time ptrace shows: getsockname(3, {sa_family=AF_INET,
 > sin_port=htons(2355), sin_addr=inet_addr("10.1.1.12")}, [16]) = 0
 > socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 4
 >
 > >How-To-Repeat:
 > Set enovriment variable to some ip
 > try to fetch some file
 
 Can't reproduce:
 
 $ export FETCH_BIND_ADDRESS=195.128.64.25
 $ fetch ftp://ftp.ee.freebsd.org/pub/FreeBSD/distfiles/libxml2-2.6.26.tar.bz2
 fetch: ftp://ftp.ee.freebsd.org/pub/FreeBSD/distfiles/libxml2-2.6.26.tar.bz2:
 File unavailable (e.g., file not found, no access)
 $ uname -r
 4.11-STABLE
 
 The same for HEAD.  Are you sure everything is OK in your environment?
 
 -- 
 Maxim Konovalov

From: Maxim Konovalov <maxim@macomnet.ru>
To: bug-followup@freebsd.org
Cc:  
Subject: bin/98839
Date: Mon, 12 Jun 2006 22:58:40 +0400 (MSD)

 The shell did help, finally figured out what was going on.  The
 warning you see is harmless.  As you see ftp.ee.freebsd.org has IPv4
 and IPv6 addresses:
 
 $ host ftp.ee.freebsd.org
 ftp.ee.freebsd.org is a nickname for ftp.estpak.ee
 ftp.estpak.ee has address 194.126.101.101
 ftp.estpak.ee has address 2001:7d0:0:1:216:35ff:fe9f:946
 ftp.estpak.ee mail is handled (pri=10) by zen.estpak.ee
 
 libfetch(3) tries to connect to IPv6 address and bind(2) fails because
 ip address you use for FETCH_BIND_ADDRESS is IPv4 one.  Then
 libfetch(3) tries to connect to IPv4 address (194.126.101.101) and
 bind(2) works OK here.  You can avoid this warning with fetch -4 flag.
 
 Hope everything clear now and I can close the PR.  Thanks for the
 shell access!
 
 -- 
 Maxim Konovalov
State-Changed-From-To: open->closed 
State-Changed-By: maxim 
State-Changed-When: Mon Jun 12 20:41:24 UTC 2006 
State-Changed-Why:  
The warning is a harmless and produced when fetch(1) tries to 
bind on IPv4 address for IPv6 destination and vice versa. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=98839 
>Unformatted:
