From owner-freebsd-bugs@FreeBSD.ORG Fri Nov 18 13:00:19 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 636731065672 for ; Fri, 18 Nov 2011 13:00:19 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3E3028FC19 for ; Fri, 18 Nov 2011 13:00:19 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id pAID0Jt6005361 for ; Fri, 18 Nov 2011 13:00:19 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id pAID0JAo005359; Fri, 18 Nov 2011 13:00:19 GMT (envelope-from gnats) Resent-Date: Fri, 18 Nov 2011 13:00:19 GMT Resent-Message-Id: <201111181300.pAID0JAo005359@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Charlie Root Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B48B1065670 for ; Fri, 18 Nov 2011 12:59:27 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id D600E8FC14 for ; Fri, 18 Nov 2011 12:59:26 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id pAICxQjx017023 for ; Fri, 18 Nov 2011 12:59:26 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id pAICxQhm017022; Fri, 18 Nov 2011 12:59:26 GMT (envelope-from nobody) Message-Id: <201111181259.pAICxQhm017022@red.freebsd.org> Date: Fri, 18 Nov 2011 12:59:26 GMT From: Charlie Root To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: bin/162661: [patch] ftp(8) is giving up on IPv6 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 13:00:19 -0000 >Number: 162661 >Category: bin >Synopsis: [patch] ftp(8) is giving up on IPv6 >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Nov 18 13:00:18 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Charlie Root >Release: FreeBSD 9.0-RC2 >Organization: none >Environment: FreeBSD b93 9.0-RC2 FreeBSD 9.0-RC2 #3: Fri Nov 18 10:35:03 UTC 2011 roo t@b93:/usr/obj/usr/src/sys/C901 i386 The kernel has been compiled with options: makeoptions MKMODULESENV+="WITHOUT_INET_SUPPORT=" nodevice gre nooptions INET options INET6 >Description: The ftp(8) cannot be used when there is no AF_INET protocol family support within kernel. There is a fragment of code in the main.c which is trying to get the socket sizes when the PF is hardcoded to AF_INET. >How-To-Repeat: 1) Compile the kernel with above options to include INET6 and exclude INET from the kernel. 2) run ftp from the shell. Here is a snippet from the screen: b93# ftp ftp: Can't create socket to determine default socket sizes: Protocol not supported b93# ftp -6 ftp: Can't create socket to determine default socket sizes: Protocol not supported b93# ftp ftp.freebsd.org. ftp: Can't create socket to determine default socket sizes: Protocol not supported b93# host -t AAAA ftp.freebsd.org. ftp.freebsd.org has IPv6 address 2001:4f8:0:2::e ftp.freebsd.org has IPv6 address 2001:6c8:2:600::132 b93# ftp 2001:4f8:0:2::e ftp: Can't create socket to determine default socket sizes: Protocol not supported >Fix: Apply the following patch: --- main.c.orig 2011-11-18 12:16:01.000000000 +0000 +++ main.c 2011-11-18 12:11:11.000000000 +0000 @@ -203,7 +203,7 @@ isupload = 0; reply_callback = NULL; #ifdef INET6 - family = AF_UNSPEC; + family = AF_INET6; #else family = AF_INET; /* force AF_INET if no INET6 support */ #endif @@ -219,7 +219,7 @@ * call no socket buffer sizes will have been modified, so we are * guaranteed to get the system defaults. */ - s = socket(AF_INET, SOCK_STREAM, 0); + s = socket(family, SOCK_STREAM, 0); if (s == -1) err(1, "Can't create socket to determine default socket sizes"); slen = sizeof(rcvbuf_size); >Release-Note: >Audit-Trail: >Unformatted: