From owner-freebsd-bugs@FreeBSD.ORG Fri Oct 17 00:20:02 2008 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 60AAE1065689 for ; Fri, 17 Oct 2008 00:20:02 +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 24C3C8FC26 for ; Fri, 17 Oct 2008 00:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id m9H0K2vo098506 for ; Fri, 17 Oct 2008 00:20:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id m9H0K12m098505; Fri, 17 Oct 2008 00:20:01 GMT (envelope-from gnats) Resent-Date: Fri, 17 Oct 2008 00:20:01 GMT Resent-Message-Id: <200810170020.m9H0K12m098505@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, Bruce Cran Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09964106568C for ; Fri, 17 Oct 2008 00:19:29 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id EBA528FC1B for ; Fri, 17 Oct 2008 00:19:28 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id m9H0JS5m085626 for ; Fri, 17 Oct 2008 00:19:28 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id m9H0JSIq085625; Fri, 17 Oct 2008 00:19:28 GMT (envelope-from nobody) Message-Id: <200810170019.m9H0JSIq085625@www.freebsd.org> Date: Fri, 17 Oct 2008 00:19:28 GMT From: Bruce Cran To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: bin/128167: [patch] [libc] add support for SCTP to getaddrinfo(3) 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, 17 Oct 2008 00:20:02 -0000 >Number: 128167 >Category: bin >Synopsis: [patch] [libc] add support for SCTP to getaddrinfo(3) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Oct 17 00:20:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Bruce Cran >Release: 8.0-CURRENT >Organization: >Environment: FreeBSD gluon.draftnet 8.0-CURRENT FreeBSD 8.0-CURRENT #2: Sun Oct 12 12:45:10 BST 2008 brucec@gluon.draftnet:/usr/obj/usr/src/sys/BOX i386 >Description: The attached patch allows getaddrinfo(3) to be used with SCTP. >How-To-Repeat: >Fix: Patch attached with submission follows: --- getaddrinfo.c 2007-09-05 19:08:14.000000000 +0100 +++ getaddrinfo.c.new 2008-10-17 01:01:42.000000000 +0100 @@ -170,13 +170,19 @@ #ifdef INET6 { PF_INET6, SOCK_DGRAM, IPPROTO_UDP, "udp", 0x07 }, { PF_INET6, SOCK_STREAM, IPPROTO_TCP, "tcp", 0x07 }, + { PF_INET6, SOCK_STREAM, IPPROTO_SCTP, "sctp", 0x07 }, + { PF_INET6, SOCK_SEQPACKET, IPPROTO_SCTP, "sctp", 0x07 }, { PF_INET6, SOCK_RAW, ANY, NULL, 0x05 }, #endif { PF_INET, SOCK_DGRAM, IPPROTO_UDP, "udp", 0x07 }, { PF_INET, SOCK_STREAM, IPPROTO_TCP, "tcp", 0x07 }, + { PF_INET, SOCK_STREAM, IPPROTO_SCTP, "sctp", 0x07 }, + { PF_INET, SOCK_SEQPACKET, IPPROTO_SCTP, "sctp", 0x07 }, { PF_INET, SOCK_RAW, ANY, NULL, 0x05 }, { PF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP, "udp", 0x07 }, { PF_UNSPEC, SOCK_STREAM, IPPROTO_TCP, "tcp", 0x07 }, + { PF_UNSPEC, SOCK_STREAM, IPPROTO_SCTP, "sctp", 0x07 }, + { PF_UNSPEC, SOCK_SEQPACKET, IPPROTO_SCTP, "sctp", 0x07 }, { PF_UNSPEC, SOCK_RAW, ANY, NULL, 0x05 }, { -1, 0, 0, NULL, 0 }, }; @@ -417,10 +423,12 @@ if (ex->e_protocol == ANY) continue; if (pai->ai_socktype == ex->e_socktype && - pai->ai_protocol != ex->e_protocol) { - ERR(EAI_BADHINTS); - } + pai->ai_protocol == ex->e_protocol) + break; } + + if (ex->e_af < 0) + ERR(EAI_BADHINTS); } } >Release-Note: >Audit-Trail: >Unformatted: