From owner-freebsd-i386@FreeBSD.ORG Wed Apr 17 06:12:22 2013 Return-Path: Delivered-To: i386@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 028811B3; Wed, 17 Apr 2013 06:12:22 +0000 (UTC) (envelope-from shonnur@chelsio.com) Received: from stargate.chelsio.com (stargate.chelsio.com [67.207.112.58]) by mx1.freebsd.org (Postfix) with ESMTP id DA5FCD5E; Wed, 17 Apr 2013 06:12:21 +0000 (UTC) Received: from maui.asicdesigners.com (maui.asicdesigners.com [10.192.180.15]) by stargate.chelsio.com (8.13.1/8.13.1) with SMTP id r3H6CL6Q015150; Tue, 16 Apr 2013 23:12:21 -0700 Received: from corona.asicdesigners.com ([10.192.160.6]) by maui.asicdesigners.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 16 Apr 2013 23:12:20 -0700 Received: from NICE.asicdesigners.com (10.192.160.7) by corona.asicdesigners.com (10.192.160.6) with Microsoft SMTP Server (TLS) id 8.3.83.0; Tue, 16 Apr 2013 23:12:20 -0700 Received: from NICE.asicdesigners.com ([fe80::51b2:ba95:9d72:babc]) by nice.asicdesigners.com ([fe80::51b2:ba95:9d72:babc%15]) with mapi id 14.02.0247.003; Tue, 16 Apr 2013 23:12:20 -0700 From: Sreenivasa Honnur To: FreeBSD Tinderbox , "current@freebsd.org" , "i386@freebsd.org" Subject: IPV6 - sobind fails with 49. Thread-Topic: IPV6 - sobind fails with 49. Thread-Index: AQHOOzKEs5g3fvMQIUCxk6hEm7kQbA== Date: Wed, 17 Apr 2013 06:12:19 +0000 Message-ID: References: <201303041621.r24GL1Dn022279@freebsd-current.sentex.ca> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.193.190.128] MIME-Version: 1.0 X-OriginalArrivalTime: 17 Apr 2013 06:12:20.0616 (UTC) FILETIME=[8500F880:01CE3B32] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 06:12:22 -0000 I am writing a kernel socket program which binds to a IPv6 address, so bind= always fails with 49. Below is the code snippet I am using, is something w= rong here? roundhay# uname -a FreeBSD roundhay 9.1-RELEASE FreeBSD 9.1-RELEASE #2: Mon Apr 8 16:15:06 IS= T 2013 root@roundhay:/usr/obj/home/freebsd.org/sys/TOED amd64 Ifconfig/ping6 output: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D cxgbe1: flags=3D8843 metric 0 mtu 1= 500 options=3D6c07bb ether 00:07:43:11:89:88 inet6 2010::102 prefixlen 64 inet6 fe80::207:43ff:fe11:8988%cxgbe1 prefixlen 64 scopeid 0xd inet6 fe80::1%cxgbe1 prefixlen 64 scopeid 0xd nd6 options=3D21 media: Ethernet 10Gbase-SR status: active roundhay# ping6 2010::101 PING6(56=3D40+8+8 bytes) 2010::102 --> 2010::101 16 bytes from 2010::101, icmp_seq=3D0 hlim=3D64 time=3D0.915 ms 16 bytes from 2010::101, icmp_seq=3D1 hlim=3D64 time=3D0.168 ms ^C --- 2010::101 ping6 statistics --- 2 packets transmitted, 2 packets received, 0.0% packet loss round-trip min/avg/max/std-dev =3D 0.168/0.541/0.915/0.374 ms Code: struct sockaddr_in6 saddr6; rv =3D socreate(AF_INET6, &sock, SOCK_STREAM, IPPROTO_TCP, td->td_ucred, td); if (rv !=3D 0) { printf("sock create ipv6 %s failed %d.\n", tbuf, rv); return NULL; } saddr6.sin6_family =3D AF_INET6; rv =3D inet_pton(AF_INET6, "2010::102", &saddr6.sin6_addr);= =3D=3D> returns 1, which indicates it's a valid IPV6 address printf("inet_pton retunred:%d\n", rv); saddr6.sin6_port =3D htons(3260); saddr6.sin6_len =3D sizeof(saddr6); rv =3D sobind(sock, (struct sockaddr *)&saddr6, td); =3D=3D= > fails with return value of 49