Date: Sun, 12 Aug 2007 13:31:50 -0700 (PDT) From: Don Lewis <truckman@FreeBSD.org> To: current@FreeBSD.org Subject: CFR/CFT: IPv6 patch for quota (PR 42004) Message-ID: <200708122031.l7CKVo3b063733@gw.catspoiler.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708122031.l7CKVo3b063733>