From owner-freebsd-current@FreeBSD.ORG Sun Aug 12 20:31:57 2007 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38BFC16A417 for ; Sun, 12 Aug 2007 20:31:57 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (adsl-75-1-14-242.dsl.scrm01.sbcglobal.net [75.1.14.242]) by mx1.freebsd.org (Postfix) with ESMTP id 17AA413C461 for ; Sun, 12 Aug 2007 20:31:57 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id l7CKVo3b063733 for ; Sun, 12 Aug 2007 13:31:54 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200708122031.l7CKVo3b063733@gw.catspoiler.org> Date: Sun, 12 Aug 2007 13:31:50 -0700 (PDT) From: Don Lewis To: current@FreeBSD.org MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: Subject: CFR/CFT: IPv6 patch for quota (PR 42004) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Aug 2007 20:31:57 -0000 PR 42004, which has been open for nearly five years, includes the patch below to add IPv6 support to /usr/bin/quota. This patch applies cleanly and compiles without error, but I'm unable to test it because I use neither IPv6 nor disk quotas over NFS. If someone who uses IPv6 and quotas over NFS can test this patch, then we could commit this change and close the PR. --- usr.bin/quota/quota.c.1.18 Fri Aug 9 06:36:48 2002 +++ usr.bin/quota/quota.c Sun Aug 25 17:43:36 2002 @@ -665,26 +665,20 @@ callaurpc(char *host, int prognum, int versnum, int procnum, xdrproc_t inproc, char *in, xdrproc_t outproc, char *out) { - struct sockaddr_in server_addr; enum clnt_stat clnt_stat; - struct hostent *hp; struct timeval timeout, tottimeout; - CLIENT *client = NULL; - int sock = RPC_ANYSOCK; + CLIENT *client; - if ((hp = gethostbyname(host)) == NULL) - return ((int) RPC_UNKNOWNHOST); + /* XXX - If clnt_call fails, we should try other addresses and AF_ */ + client = clnt_create(host, prognum, versnum, "udp"); + if (client == NULL) + return ((int) rpc_createerr.cf_stat); + timeout.tv_usec = 0; timeout.tv_sec = 6; - bcopy(hp->h_addr, &server_addr.sin_addr, - MIN(hp->h_length,(int)sizeof(server_addr.sin_addr))); - server_addr.sin_family = AF_INET; - server_addr.sin_port = 0; - - if ((client = clntudp_create(&server_addr, prognum, - versnum, timeout, &sock)) == NULL) - return ((int) rpc_createerr.cf_stat); + (void) CLNT_CONTROL(client, + CLSET_RETRY_TIMEOUT, (char *)(void *)&timeout); client->cl_auth = authunix_create_default(); tottimeout.tv_sec = 25;