commit:     705c15080a5c97f74c2c531a1d620e45827d61f8
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 17 18:04:21 2017 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sun Dec 17 18:04:21 2017 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=705c1508

net-libs/libtirpc: version bump

Package-Manager: Portage-2.3.13, Repoman-2.3.3
RepoMan-Options: --force

 net-libs/libtirpc/Manifest                         |    3 +-
 ...rpcbynumber-and-getrpcbyname-if-those-are.patch |   85 --
 .../libtirpc/files/0002-Misc-header-fixes.patch    |   40 -
 .../libtirpc/files/0003-fix_cdefs_h_include.patch  |  618 ----------
 net-libs/libtirpc/files/0004-fix_DECLS.patch       | 1226 --------------------
 .../libtirpc/files/0005-fix_remaining_issues.patch |   14 -
 net-libs/libtirpc/files/0007-no-des.patch          |   29 -
 net-libs/libtirpc/files/git.patch                  |  842 --------------
 .../libtirpc/files/libtirpc-0.2.5-stdarg.patch     |   29 -
 .../files/libtirpc-1.0.1-CVE-2017-8779.patch       |  255 ----
 .../files/libtirpc-1.0.2-bcopy-to-memmove.patch    |   49 +
 .../files/libtirpc-1.0.2-bzero-to-memset.patch     |   36 +
 .../libtirpc/files/libtirpc-1.0.2-exports.patch    |   17 +
 .../libtirpc/files/libtirpc-1.0.2-glibc-2.26.patch |   12 +
 net-libs/libtirpc/libtirpc-0.2.5.ebuild            |   73 --
 ...pc-1.0.1-r1.ebuild => libtirpc-1.0.2-r1.ebuild} |   12 +-
 16 files changed, 122 insertions(+), 3218 deletions(-)

diff --git a/net-libs/libtirpc/Manifest b/net-libs/libtirpc/Manifest
index 5e5ffd9..a1f6f69 100644
--- a/net-libs/libtirpc/Manifest
+++ b/net-libs/libtirpc/Manifest
@@ -1,3 +1,2 @@
-DIST libtirpc-0.2.5.tar.bz2 459094 SHA256 
62f9de7c2c8686c568757730e1fef66502a0e00d6cacf33546d0267984e002db SHA512 
9f8afa1acb04a2c2c558018f2528f8caaa79994a2af2abeed947f914145872ef72988b241e11925c799db0de9ec51fd9baecd2b08150240b22f91e2e55a45194
 WHIRLPOOL 
a2b4f1c4825f2b774c2290cccd9d552bb7566ec9eb5988d3ab619d7870a907600f67e7af39fbc3e245606db8534f114c990145789c383206d3a9cf96cf043d8c
-DIST libtirpc-1.0.1.tar.bz2 495125 SHA256 
5156974f31be7ccbc8ab1de37c4739af6d9d42c87b1d5caf4835dda75fcbb89e SHA512 
c9b449e737bc2bd3d56e31e8352f312e89a7ec2a11b73b5ac314e7d82d3b644c611e422b623912453b67b668f86a6de7bb7f18c9495dd15de8e2798ec2ff41c8
 WHIRLPOOL 
cce6a4e69bd634b40d66594a81c23d2044b63eec16d6c96d6fcfaa7f2ca41fb9af99c8e2b964ec12be82682afa4090b218d7e14399fdfc9b32df6c2234bc3c9e
+DIST libtirpc-1.0.2.tar.bz2 509601 SHA256 
723c5ce92706cbb601a8db09110df1b4b69391643158f20ff587e20e7c5f90f5 SHA512 
6c819019a8e81d8263d3c509b2eee59ba1ef092222c5a0a8d28f004c711afa252097eca7e6b0b919b2d780883dfd9ee7a363df4cee7fd2c9159a065257637cec
 WHIRLPOOL 
59306a645df28cfcfc1bf9e5215c59f0af7b8a01375ccef66c2ded4863e7183afd4b3ae0e7694f3eff78cc88f3978a4fd0c1b3375698fb90b59a08989021ebdc
 DIST libtirpc-glibc-nfs.tar.xz 8948 SHA256 
2677cfedf626f3f5a8f6e507aed5bb8f79a7453b589d684dbbc086e755170d83 SHA512 
90255bf0a27af16164e0710dd940778609925d473f4343093ff19d98cc4f23023788bf4edf0178eae1961afc0ba8b69b273de95b7d7e2afdb706701d8ba6f7ba
 WHIRLPOOL 
06bcf3fd4e424a86071e5c4ddeb89aa571c862e765aae9382d9f9a55ab72cd1c623490555c1a9bd3380a2d04ecb10fb47a75a7dddf449d4368a1a01617226858

diff --git 
a/net-libs/libtirpc/files/0001-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
 
b/net-libs/libtirpc/files/0001-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
deleted file mode 100644
index 3708638..0000000
--- 
a/net-libs/libtirpc/files/0001-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-From d3b5ffed6d7d49cc93b2343afcf0e4502a3e54ce Mon Sep 17 00:00:00 2001
-From: Natanael Copa <[email protected]>
-Date: Thu, 24 Apr 2014 09:19:45 +0200
-Subject: [PATCH 1/2] Provide getrpcbynumber and getrpcbyname if those are
- missing
-
-We enable the config.h again and check fi getrpcbynumber and
-getrpcbyname exists on the building patform. If it does not exist, then
-provide those functions.
-
-This is needed for musl libc.
----
- configure.ac    |  6 ++++--
- src/getrpcent.c | 10 ++++++++--
- 2 files changed, 12 insertions(+), 4 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 10d17ea..0180801 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -24,14 +24,16 @@ if test "x$enable_ipv6" != xno; then
- fi
- 
- AC_PROG_CC
--m4_pattern_allow(AM_CONFIG_HEADERS(config.h))
-+AC_CONFIG_HEADERS([config.h])
- AC_PROG_LIBTOOL
- AC_HEADER_DIRENT
- AC_PREFIX_DEFAULT(/usr)
- AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h limits.h locale.h netdb.h 
netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/param.h 
sys/socket.h sys/time.h syslog.h unistd.h])
- AC_CHECK_LIB([pthread], [pthread_create])
- AC_CHECK_LIB([nsl], [yp_get_default_domain])
--
-+AC_CHECK_FUNCS([getrpcbyname getrpcbynumber])
- 
- AC_CONFIG_FILES([Makefile src/Makefile man/Makefile doc/Makefile])
- AC_OUTPUT(libtirpc.pc)
-+
-+
-diff --git a/src/getrpcent.c b/src/getrpcent.c
-index 1b54b6d..6da006a 100644
---- a/src/getrpcent.c
-+++ b/src/getrpcent.c
-@@ -50,6 +50,10 @@
- #include <libc_private.h>
- #endif
- 
-+#if HAVE_CONFIG_H
-+#include "config.h"
-+#endif
-+
- /*
-  * Internet version.
-  */
-@@ -89,7 +93,7 @@ _rpcdata()
-       return (d);
- }
- 
--#ifdef GQ
-+#if !HAVE_GETRPCBYNYMBER
- struct rpcent *
- getrpcbynumber(number)
-       int number;
-@@ -135,7 +139,9 @@ no_yp:
-       endrpcent();
-       return (p);
- }
-+#endif /* !HAVE_GETRPCBYNUMBER */
- 
-+#if !HAVE_GETRPCBYNAME
- struct rpcent *
- getrpcbyname(name)
-       const char *name;
-@@ -158,7 +164,7 @@ done:
-       endrpcent();
-       return (rpc);
- }
--#endif /* GQ */
-+#endif /* !HAVE_GETRPCBYNAME */
- 
- void
- setrpcent(f)
--- 
-1.9.2
-

diff --git a/net-libs/libtirpc/files/0002-Misc-header-fixes.patch 
b/net-libs/libtirpc/files/0002-Misc-header-fixes.patch
deleted file mode 100644
index 9287d03..0000000
--- a/net-libs/libtirpc/files/0002-Misc-header-fixes.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From ed6dc31ed1092baf42f99278ef9c5c297805c3d0 Mon Sep 17 00:00:00 2001
-From: Natanael Copa <[email protected]>
-Date: Thu, 24 Apr 2014 08:58:20 +0200
-Subject: [PATCH 2/2] Misc header fixes
-
-src/bindresvport.c: IPPORT_RESERVED needs netdb.h
-
-Misc fixes for building on musl libc
----
- src/bindresvport.c | 1 +
- tirpc/netconfig.h  | 1 +
- tirpc/rpc/rpcent.h | 2 +-
- tirpc/rpc/types.h  | 1 +
- 4 files changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/src/bindresvport.c b/src/bindresvport.c
-index d6d9c14..5a7a1a9 100644
---- a/src/bindresvport.c
-+++ b/src/bindresvport.c
-@@ -37,6 +37,7 @@
- #include <sys/types.h>
- #include <sys/socket.h>
- 
-+#include <netdb.h>
- #include <netinet/in.h>
- 
- #include <errno.h>
-diff --git a/tirpc/rpc/rpcent.h b/tirpc/rpc/rpcent.h
-index c865e51..a36cf91 100644
---- a/tirpc/rpc/rpcent.h
-+++ b/tirpc/rpc/rpcent.h
-@@ -47,7 +47,7 @@
- __BEGIN_DECLS
- 
- /* These are defined in /usr/include/rpc/netdb.h */
--#if 0
-+#if !defined(__GLIBC__)
- struct rpcent {
-       char    *r_name;        /* name of server for this rpc program */
-       char    **r_aliases;    /* alias list */

diff --git a/net-libs/libtirpc/files/0003-fix_cdefs_h_include.patch 
b/net-libs/libtirpc/files/0003-fix_cdefs_h_include.patch
deleted file mode 100644
index 4f09b70..0000000
--- a/net-libs/libtirpc/files/0003-fix_cdefs_h_include.patch
+++ /dev/null
@@ -1,618 +0,0 @@
---- ./tirpc/rpc/xdr.h.orig     2014-11-28 09:09:44.902289976 +0000
-+++ ./tirpc/rpc/xdr.h  2014-11-28 09:09:44.903289976 +0000
-@@ -40,7 +40,9 @@
- 
- #ifndef _TIRPC_XDR_H
- #define _TIRPC_XDR_H
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- #include <stdio.h>
- #include <netinet/in.h>
- 
---- ./tirpc/rpc/pmap_prot.h.orig       2014-11-28 09:09:44.901289976 +0000
-+++ ./tirpc/rpc/pmap_prot.h    2014-11-28 09:09:44.902289976 +0000
-@@ -71,7 +71,9 @@
- 
- #ifndef _RPC_PMAP_PROT_H
- #define _RPC_PMAP_PROT_H
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- #define PMAPPORT              ((u_short)111)
- #define PMAPPROG              ((u_long)100000)
---- ./tirpc/rpc/auth.h.orig    2014-11-28 09:09:44.896289976 +0000
-+++ ./tirpc/rpc/auth.h 2014-11-28 09:09:44.897289976 +0000
-@@ -48,7 +48,9 @@
- 
- #include <rpc/xdr.h>
- #include <rpc/clnt_stat.h>
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- #include <sys/socket.h>
- #include <sys/types.h>
- 
---- ./tirpc/rpc/svc.h.orig     2014-11-28 09:09:44.904289976 +0000
-+++ ./tirpc/rpc/svc.h  2014-11-28 09:09:44.905289976 +0000
-@@ -40,7 +40,9 @@
- 
- #ifndef _TIRPC_SVC_H
- #define _TIRPC_SVC_H
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- /*
-  * This interface must manage two items concerning remote procedure calling:
---- ./tirpc/rpc/svc_soc.h.orig 2014-11-28 09:09:44.906289976 +0000
-+++ ./tirpc/rpc/svc_soc.h      2014-11-28 09:09:44.907289976 +0000
-@@ -38,7 +38,9 @@
- 
- #ifndef _RPC_SVC_SOC_H
- #define _RPC_SVC_SOC_H
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- /* #pragma ident   "@(#)svc_soc.h  1.11    94/04/25 SMI" */
- /*      svc_soc.h 1.8 89/05/01 SMI      */
---- ./tirpc/rpc/clnt_soc.h.orig        2014-11-28 09:09:44.893289976 +0000
-+++ ./tirpc/rpc/clnt_soc.h     2014-11-28 09:09:44.894289976 +0000
-@@ -46,7 +46,9 @@
-  * with TS-RPC.
-  */
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- #define UDPMSGSIZE      8800    /* rpc imposed limit on udp msg size */  
- 
---- ./tirpc/rpc/rpc_com.h.orig 2014-11-28 09:09:44.894289976 +0000
-+++ ./tirpc/rpc/rpc_com.h      2014-11-28 09:09:44.894289976 +0000
-@@ -41,7 +41,9 @@
- #ifndef _RPC_RPCCOM_H
- #define       _RPC_RPCCOM_H
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- /* #pragma ident      "@(#)rpc_com.h  1.11    93/07/05 SMI" */
- 
---- ./tirpc/rpc/auth_unix.h.orig       2014-11-28 09:09:44.905289976 +0000
-+++ ./tirpc/rpc/auth_unix.h    2014-11-28 09:09:44.906289976 +0000
-@@ -45,7 +45,9 @@
- 
- #ifndef _TIRPC_AUTH_UNIX_H
- #define _TIRPC_AUTH_UNIX_H
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- /* The machine name is part of a credential; it may not exceed 255 bytes */
- #define MAX_MACHINE_NAME 255
---- ./tirpc/rpc/pmap_rmt.h.orig        2014-11-28 09:09:44.899289976 +0000
-+++ ./tirpc/rpc/pmap_rmt.h     2014-11-28 09:09:44.900289976 +0000
-@@ -41,7 +41,9 @@
- 
- #ifndef _RPC_PMAP_RMT_H
- #define _RPC_PMAP_RMT_H
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- struct rmtcallargs {
-       u_long prog, vers, proc, arglen;
---- ./tirpc/rpc/des_crypt.h.orig       2014-11-28 09:09:44.900289976 +0000
-+++ ./tirpc/rpc/des_crypt.h    2014-11-28 09:09:44.901289976 +0000
-@@ -43,7 +43,9 @@
- #ifndef _DES_DES_CRYPT_H
- #define _DES_DES_CRYPT_H
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- #include <rpc/rpc.h>
- 
- #define DES_MAXDATA 8192      /* max bytes encrypted in one call */
---- ./tirpc/rpc/clnt.h.orig    2014-11-28 09:09:44.897289976 +0000
-+++ ./tirpc/rpc/clnt.h 2014-11-28 09:09:44.899289976 +0000
-@@ -42,7 +42,9 @@
- #include <rpc/clnt_stat.h>
- #include <rpc/auth.h>
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- #include <netconfig.h>
- #include <sys/un.h>
- 
---- ./tirpc/rpc/pmap_clnt.h.orig       2014-11-28 09:09:44.895289976 +0000
-+++ ./tirpc/rpc/pmap_clnt.h    2014-11-28 09:09:44.895289976 +0000
-@@ -63,7 +63,9 @@
- 
- #ifndef _RPC_PMAP_CLNT_H_
- #define _RPC_PMAP_CLNT_H_
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- __BEGIN_DECLS
- extern bool_t         pmap_set(u_long, u_long, int, int);
---- ./tirpc/rpcsvc/crypt.x.orig        2014-11-28 09:09:44.907289976 +0000
-+++ ./tirpc/rpcsvc/crypt.x     2014-11-28 09:09:44.908289976 +0000
-@@ -31,7 +31,9 @@
-  */
- 
- #ifndef RPC_HDR
--%#include <sys/cdefs.h>
-+%#ifdef __GLIBC__
-+%#include <sys/cdefs.h>
-+%#endif
- %__FBSDID("$FreeBSD: src/include/rpcsvc/crypt.x,v 1.5 2003/05/04 02:51:42 
obrien Exp $");
- #endif
- 
---- ./src/auth_none.c.orig     2014-11-28 09:09:44.875289976 +0000
-+++ ./src/auth_none.c  2014-11-28 09:09:44.876289976 +0000
-@@ -31,7 +31,9 @@
- static char *sccsid = "@(#)auth_none.c 1.19 87/08/11 Copyr 1984 Sun Micro";
- static char *sccsid = "@(#)auth_none.c        2.1 88/07/29 4.0 RPCSRC";
- #endif
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- __FBSDID("$FreeBSD: src/lib/libc/rpc/auth_none.c,v 1.12 2002/03/22 23:18:35 
obrien Exp $");
- */
- 
---- ./src/crypt_client.c.orig  2014-11-28 09:09:44.886289976 +0000
-+++ ./src/crypt_client.c       2014-11-28 09:09:44.886289976 +0000
-@@ -30,7 +30,9 @@
-  * SUCH DAMAGE.
-  */
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- #include <err.h>
- #include <sys/types.h>
---- ./src/xdr_reference.c.orig 2014-11-28 09:09:44.858289976 +0000
-+++ ./src/xdr_reference.c      2014-11-28 09:09:44.859289976 +0000
-@@ -26,8 +26,12 @@
-  * POSSIBILITY OF SUCH DAMAGE.
-  */
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- /*
-  * xdr_reference.c, Generic XDR routines impelmentation.
---- ./src/auth_unix.c.orig     2014-11-28 09:09:44.863289976 +0000
-+++ ./src/auth_unix.c  2014-11-28 09:09:44.864289976 +0000
-@@ -26,7 +26,9 @@
-  * POSSIBILITY OF SUCH DAMAGE.
-  */
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- /*
-  * auth_unix.c, Implements UNIX style authentication parameters.
---- ./src/authdes_prot.c.orig  2014-11-28 09:09:44.868289976 +0000
-+++ ./src/authdes_prot.c       2014-11-28 09:09:44.869289976 +0000
-@@ -1,4 +1,6 @@
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- /*
-  * Copyright (c) 2009, Sun Microsystems, Inc.
-  * All rights reserved.
---- ./src/rpcb_st_xdr.c.orig   2014-11-28 09:09:44.847289976 +0000
-+++ ./src/rpcb_st_xdr.c        2014-11-28 09:09:44.848289976 +0000
-@@ -35,7 +35,9 @@
-  * routines used with the rpcbind stats facility.
-  */
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- #include <rpc/rpc.h>
- 
---- ./src/auth_time.c.orig     2014-11-28 09:09:44.887289976 +0000
-+++ ./src/auth_time.c  2014-11-28 09:09:44.888289976 +0000
-@@ -25,7 +25,9 @@
-  *    needed to deal with TCP connections.
-  */
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- #include <stdio.h>
- #include <syslog.h>
- #include <string.h>
---- ./src/des_crypt.c.orig     2014-11-28 09:09:44.871289976 +0000
-+++ ./src/des_crypt.c  2014-11-28 09:09:44.872289976 +0000
-@@ -39,7 +39,9 @@
- static char sccsid[] = "@(#)des_crypt.c       2.2 88/08/10 4.0 RPCSRC; from 
1.13 88/02/08 SMI";
- #endif
- #endif
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- static int common_crypt( char *, char *, unsigned, unsigned, struct desparams 
* );
- int (*__des_crypt_LOCAL)() = 0;
---- ./src/svc_vc.c.orig        2014-11-28 09:09:44.878289976 +0000
-+++ ./src/svc_vc.c     2014-11-28 09:09:44.879289976 +0000
-@@ -27,7 +27,9 @@
-  * POSSIBILITY OF SUCH DAMAGE.
-  */
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- /*
-  * svc_vc.c, Server side for Connection Oriented based RPC. 
---- ./src/xdr_float.c.orig     2014-11-28 09:09:44.882289976 +0000
-+++ ./src/xdr_float.c  2014-11-28 09:09:44.883289976 +0000
-@@ -27,7 +27,9 @@
-  * POSSIBILITY OF SUCH DAMAGE.
-  */
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- /*
-  * xdr_float.c, Generic XDR routines implementation.
---- ./src/xdr_sizeof.c.orig    2014-11-28 09:09:44.865289976 +0000
-+++ ./src/xdr_sizeof.c 2014-11-28 09:09:44.866289976 +0000
-@@ -34,7 +34,9 @@
-  * when serialized using XDR.
-  */
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- #include <rpc/types.h>
- #include <rpc/xdr.h>
---- ./src/xdr_array.c.orig     2014-11-28 09:09:44.892289976 +0000
-+++ ./src/xdr_array.c  2014-11-28 09:09:44.893289976 +0000
-@@ -27,7 +27,9 @@
-  * POSSIBILITY OF SUCH DAMAGE.
-  */
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- /*
-  * xdr_array.c, Generic XDR routines impelmentation.
---- ./src/rpc_generic.c.orig   2014-11-28 09:09:44.842289976 +0000
-+++ ./src/rpc_generic.c        2014-11-28 09:09:44.844289976 +0000
-@@ -29,7 +29,9 @@
-  * Copyright (c) 1986-1991 by Sun Microsystems Inc. 
-  */
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- /*
-  * rpc_generic.c, Miscl routines for RPC.
---- ./src/getpeereid.c.orig    2014-11-28 09:09:44.855289976 +0000
-+++ ./src/getpeereid.c 2014-11-28 09:09:44.856289976 +0000
-@@ -24,7 +24,9 @@
-  * SUCH DAMAGE.
-  */
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- #include <sys/param.h>
- #include <sys/socket.h>
---- ./src/xdr_stdio.c.orig     2014-11-28 09:09:44.880289976 +0000
-+++ ./src/xdr_stdio.c  2014-11-28 09:09:44.881289976 +0000
-@@ -26,7 +26,9 @@
-  * POSSIBILITY OF SUCH DAMAGE.
-  */
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- /*
-  * xdr_stdio.c, XDR implementation on standard i/o file.
---- ./src/clnt_bcast.c.orig    2014-11-28 09:09:44.859289976 +0000
-+++ ./src/clnt_bcast.c 2014-11-28 09:09:44.861289976 +0000
-@@ -28,7 +28,9 @@
- /*
-  * Copyright (c) 1986-1991 by Sun Microsystems Inc. 
-  */
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- /*
-  * clnt_bcast.c
---- ./src/xdr_mem.c.orig       2014-11-28 09:09:44.876289976 +0000
-+++ ./src/xdr_mem.c    2014-11-28 09:09:44.877289976 +0000
-@@ -26,7 +26,9 @@
-  * POSSIBILITY OF SUCH DAMAGE.
-  */
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- /*
-  * xdr_mem.h, XDR implementation using memory buffers.
---- ./src/key_call.c.orig      2014-11-28 09:09:44.889289976 +0000
-+++ ./src/key_call.c   2014-11-28 09:09:44.890289976 +0000
-@@ -30,7 +30,9 @@
-  */
- 
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- /*
-  * key_call.c, Interface to keyserver
---- ./src/svc_simple.c.orig    2014-11-28 09:09:44.874289976 +0000
-+++ ./src/svc_simple.c 2014-11-28 09:09:44.875289976 +0000
-@@ -29,7 +29,9 @@
-  * Copyright (c) 1986-1991 by Sun Microsystems Inc. 
-  */
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- /*
-  * svc_simple.c
---- ./src/mt_misc.c.orig       2014-11-28 09:09:44.870289976 +0000
-+++ ./src/mt_misc.c    2014-11-28 09:09:44.871289976 +0000
-@@ -1,5 +1,7 @@
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- #include <pthread.h>
- #include <reentrant.h>
- #include <rpc/rpc.h>
---- ./src/authunix_prot.c.orig 2014-11-28 09:09:44.885289976 +0000
-+++ ./src/authunix_prot.c      2014-11-28 09:09:44.885289976 +0000
-@@ -26,7 +26,9 @@
-  * POSSIBILITY OF SUCH DAMAGE.
-  */
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- /*
-  * authunix_prot.c
---- ./src/des_soft.c.orig      2014-11-28 09:09:44.851289976 +0000
-+++ ./src/des_soft.c   2014-11-28 09:09:44.851289976 +0000
-@@ -1,4 +1,6 @@
--//#include <sys/cdefs.h>
-+//#ifdef __GLIBC__
-+#include <sys/cdefs.h>
-+#endif
- 
- /*
-  * Copyright (c) 2009, Sun Microsystems, Inc.
---- ./src/rpcdname.c.orig      2014-11-28 09:09:44.850289976 +0000
-+++ ./src/rpcdname.c   2014-11-28 09:09:44.850289976 +0000
-@@ -25,7 +25,9 @@
-  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-  * POSSIBILITY OF SUCH DAMAGE.
-  */
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- /*
-  * rpcdname.c
---- ./src/getnetpath.c.orig    2014-11-28 09:09:44.884289976 +0000
-+++ ./src/getnetpath.c 2014-11-28 09:09:44.884289976 +0000
-@@ -25,13 +25,17 @@
-  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-  * POSSIBILITY OF SUCH DAMAGE.
-  */
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- /*
-  * Copyright (c) 1989 by Sun Microsystems, Inc.
-  */
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- #include <stdio.h>
- #include <errno.h>
- #include <netconfig.h>
---- ./src/svc_dg.c.orig        2014-11-28 09:09:44.852289976 +0000
-+++ ./src/svc_dg.c     2014-11-28 09:09:44.853289976 +0000
-@@ -31,7 +31,9 @@
-  * Copyright (c) 1986-1991 by Sun Microsystems Inc.
-  */
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- /*
-  * svc_dg.c, Server side for connectionless RPC.
---- ./src/rpc_com.h.orig       2014-11-28 09:09:44.845289976 +0000
-+++ ./src/rpc_com.h    2014-11-28 09:09:44.846289976 +0000
-@@ -40,7 +40,9 @@
- #ifndef _TIRPC_RPCCOM_H
- #define       _TIRPC_RPCCOM_H
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- /* #pragma ident      "@(#)rpc_com.h  1.11    93/07/05 SMI" */
- 
---- ./src/pmap_getmaps.c.orig  2014-11-28 09:09:44.891289976 +0000
-+++ ./src/pmap_getmaps.c       2014-11-28 09:09:44.892289976 +0000
-@@ -26,7 +26,9 @@
-  * POSSIBILITY OF SUCH DAMAGE.
-  */
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- /*
-  * pmap_getmap.c
---- ./src/pmap_clnt.c.orig     2014-11-28 09:09:44.869289976 +0000
-+++ ./src/pmap_clnt.c  2014-11-28 09:09:44.870289976 +0000
-@@ -26,7 +26,9 @@
-  * POSSIBILITY OF SUCH DAMAGE.
-  */
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- /*
-  * pmap_clnt.c
---- ./src/bindresvport.c.orig  2014-11-28 09:09:44.848289976 +0000
-+++ ./src/bindresvport.c       2014-11-28 09:09:44.849289976 +0000
-@@ -26,7 +26,9 @@
-  * POSSIBILITY OF SUCH DAMAGE.
-  */
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- /*
-  * Copyright (c) 1987 by Sun Microsystems, Inc.
---- ./src/xdr_rec.c.orig       2014-11-28 09:09:44.866289976 +0000
-+++ ./src/xdr_rec.c    2014-11-28 09:09:44.868289976 +0000
-@@ -27,8 +27,12 @@
-  * POSSIBILITY OF SUCH DAMAGE.
-  */
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- /*
-  * xdr_rec.c, Implements TCP/IP based XDR streams with a "record marking"
---- ./src/clnt_perror.c.orig   2014-11-28 09:09:44.854289976 +0000
-+++ ./src/clnt_perror.c        2014-11-28 09:09:44.855289976 +0000
-@@ -27,7 +27,9 @@
-  */
- 
- /*
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- */
- /*
-  * clnt_perror.c
---- ./src/key_prot_xdr.c.orig  2014-11-28 09:09:44.888289976 +0000
-+++ ./src/key_prot_xdr.c       2014-11-28 09:09:44.889289976 +0000
-@@ -33,7 +33,9 @@
-  */
- /* Copyright (c)  1990, 1991 Sun Microsystems, Inc. */
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- /* 
-  * Compiled from key_prot.x using rpcgen.
---- ./src/getnetconfig.c.orig  2014-11-28 09:09:44.856289976 +0000
-+++ ./src/getnetconfig.c       2014-11-28 09:09:44.858289976 +0000
-@@ -32,7 +32,9 @@
-  
- #include <pthread.h>
- #include <reentrant.h>
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- #include <stdio.h>
- #include <errno.h>
- #include <netconfig.h>
---- ./src/getpublickey.c.orig  2014-11-28 09:09:44.844289976 +0000
-+++ ./src/getpublickey.c       2014-11-28 09:09:44.845289976 +0000
-@@ -26,7 +26,9 @@
-  * POSSIBILITY OF SUCH DAMAGE.
-  */
- /*
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- */
- 
- /*
---- ./src/clnt_simple.c.orig   2014-11-28 09:09:44.881289976 +0000
-+++ ./src/clnt_simple.c        2014-11-28 09:09:44.882289976 +0000
-@@ -29,7 +29,9 @@
-  * Copyright (c) 1986-1991 by Sun Microsystems Inc. 
-  */
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- /*
-  * clnt_simple.c
---- ./src/auth_des.c.orig      2014-11-28 09:09:44.872289976 +0000
-+++ ./src/auth_des.c   2014-11-28 09:09:44.874289976 +0000
-@@ -38,7 +38,9 @@
- #include <string.h>
- #include <stdlib.h>
- #include <unistd.h>
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- #include <rpc/des_crypt.h>
- #include <syslog.h>
- #include <rpc/types.h>
-@@ -52,7 +54,9 @@
- 
- #if defined(LIBC_SCCS) && !defined(lint)
- #endif
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- #include "debug.h"
- 
---- ./src/xdr.c.orig   2014-11-28 09:09:44.861289976 +0000
-+++ ./src/xdr.c        2014-11-28 09:09:44.863289976 +0000
-@@ -26,7 +26,9 @@
-  * POSSIBILITY OF SUCH DAMAGE.
-  */
- 
-+#ifdef __GLIBC__
- #include <sys/cdefs.h>
-+#endif
- 
- /*
-  * xdr.c, Generic XDR routines implementation.

diff --git a/net-libs/libtirpc/files/0004-fix_DECLS.patch 
b/net-libs/libtirpc/files/0004-fix_DECLS.patch
deleted file mode 100644
index 86abf77..0000000
--- a/net-libs/libtirpc/files/0004-fix_DECLS.patch
+++ /dev/null
@@ -1,1226 +0,0 @@
---- ./tirpc/rpc/xdr.h.orig     2014-11-28 09:16:53.990289976 +0000
-+++ ./tirpc/rpc/xdr.h  2014-11-28 09:16:53.991289976 +0000
-@@ -289,7 +289,11 @@ struct xdr_discrim {
- /*
-  * These are the "generic" xdr routines.
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern bool_t xdr_void(void);
- extern bool_t xdr_int(XDR *, int *);
- extern bool_t xdr_u_int(XDR *, u_int *);
-@@ -332,7 +336,11 @@ extern bool_t     xdr_hyper(XDR *, quad_t *)
- extern bool_t xdr_u_hyper(XDR *, u_quad_t *);
- extern bool_t xdr_longlong_t(XDR *, quad_t *);
- extern bool_t xdr_u_longlong_t(XDR *, u_quad_t *);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- /*
-  * Common opaque bytes objects used by many rpc protocols;
-@@ -350,7 +358,11 @@ extern bool_t   xdr_netobj(XDR *, struct
-  * These are the public routines for the various implementations of
-  * xdr streams.
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- /* XDR using memory buffers */
- extern void   xdrmem_create(XDR *, char *, u_int, enum xdr_op);
- 
-@@ -371,6 +383,10 @@ extern bool_t xdrrec_skiprecord(XDR *);
- /* true if no more input */
- extern bool_t xdrrec_eof(XDR *);
- extern u_int xdrrec_readbytes(XDR *, caddr_t, u_int);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- #endif /* !_TIRPC_XDR_H */
---- ./tirpc/rpc/auth_des.h.orig        2014-11-28 09:16:53.994289976 +0000
-+++ ./tirpc/rpc/auth_des.h     2014-11-28 09:16:53.995289976 +0000
-@@ -114,17 +114,33 @@ struct authdes_verf {
-  * Map a des credential into a unix cred.
-  *
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern int authdes_getucred( struct authdes_cred *, uid_t *, gid_t *, int *, 
gid_t * );
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern bool_t xdr_authdes_cred(XDR *, struct authdes_cred *);
- extern bool_t xdr_authdes_verf(XDR *, struct authdes_verf *);
- extern int    rtime(dev_t, struct netbuf *, int, struct timeval *,
-                   struct timeval *);
- extern void   kgetnetname(char *);
- extern enum auth_stat _svcauth_des(struct svc_req *, struct rpc_msg *);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- #endif /* ndef _TI_AUTH_DES_ */
---- ./tirpc/rpc/pmap_prot.h.orig       2014-11-28 09:16:53.988289976 +0000
-+++ ./tirpc/rpc/pmap_prot.h    2014-11-28 09:16:53.989289976 +0000
-@@ -99,10 +99,18 @@ struct pmaplist {
-       struct pmaplist *pml_next;
- };
- 
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern bool_t xdr_pmap(XDR *, struct pmap *);
- extern bool_t xdr_pmaplist(XDR *, struct pmaplist **);
- extern bool_t xdr_pmaplist_ptr(XDR *, struct pmaplist *);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- #endif /* !_RPC_PMAP_PROT_H */
---- ./tirpc/rpc/auth.h.orig    2014-11-28 09:16:53.982289976 +0000
-+++ ./tirpc/rpc/auth.h 2014-11-28 09:16:53.983289976 +0000
-@@ -166,9 +166,17 @@ union des_block {
-       char c[8];
- };
- typedef union des_block des_block;
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern bool_t xdr_des_block(XDR *, des_block *);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- /*
-  * Authentication info.  Opaque to client.
-@@ -279,9 +287,17 @@ auth_put(AUTH *auth)
-               xfunc, xwhere))
- 
- 
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern struct opaque_auth _null_auth;
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- /*
-  * Any style authentication.  These routines can be used by any
-@@ -302,11 +318,19 @@ int authany_wrap(void), authany_unwrap(v
-  *    int len;
-  *    int *aup_gids;
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern AUTH *authunix_create(char *, uid_t, uid_t, int, uid_t *);
- extern AUTH *authunix_create_default(void);   /* takes no parameters */
- extern AUTH *authnone_create(void);           /* takes no parameters */
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- /*
-  * DES style authentication
-  * AUTH *authsecdes_create(servername, window, timehost, ckey)
-@@ -315,15 +339,31 @@ __END_DECLS
-  *    const char *timehost;                   - optional hostname to sync with
-  *    des_block *ckey;                - optional conversation key to use
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern AUTH *authdes_create (char *, u_int, struct sockaddr *, des_block *);
- extern AUTH *authdes_seccreate (const char *, const u_int, const  char *,
-     const  des_block *);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern bool_t xdr_opaque_auth         (XDR *, struct opaque_auth *);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- #define authsys_create(c,i1,i2,i3,ip) authunix_create((c),(i1),(i2),(i3),(ip))
- #define authsys_create_default() authunix_create_default()
-@@ -331,36 +371,60 @@ __END_DECLS
- /*
-  * Netname manipulation routines.
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern int getnetname(char *);
- extern int host2netname(char *, const char *, const char *);
- extern int user2netname(char *, const uid_t, const char *);
- extern int netname2user(char *, uid_t *, gid_t *, int *, gid_t *);
- extern int netname2host(char *, char *, const int);
- extern void passwd2des ( char *, char * );
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- /*
-  *
-  * These routines interface to the keyserv daemon
-  *
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern int key_decryptsession(const char *, des_block *);
- extern int key_encryptsession(const char *, des_block *);
- extern int key_gendes(des_block *);
- extern int key_setsecret(const char *);
- extern int key_secretkey_is_set(void);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- /*
-  * Publickey routines.
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern int getpublickey (const char *, char *);
- extern int getpublicandprivatekey (char *, char *);
- extern int getsecretkey (char *, char *, char *);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- #ifdef KERBEROS
- /*
-@@ -373,10 +437,18 @@ __END_DECLS
-  *    const char *timehost;                   - optional hostname to sync with
-  *    int *status;                            - kerberos status returned
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern AUTH   *authkerb_seccreate(const char *, const char *, const  char *,
-                   const u_int, const char *, int *);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- /*
-  * Map a kerberos credential into a unix cred.
-@@ -389,20 +461,36 @@ __END_DECLS
-  *    int *groups;
-  *
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern int    authkerb_getucred(/* struct svc_req *, uid_t *, gid_t *,
-                   short *, int * */);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- #endif /* KERBEROS */
- 
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- struct svc_req;
- struct rpc_msg;
- enum auth_stat _svcauth_none (struct svc_req *, struct rpc_msg *);
- enum auth_stat _svcauth_short (struct svc_req *, struct rpc_msg *);
- enum auth_stat _svcauth_unix (struct svc_req *, struct rpc_msg *);
- enum auth_stat _svcauth_gss (struct svc_req *, struct rpc_msg *, bool_t *);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- #define AUTH_NONE     0               /* no authentication */
- #define       AUTH_NULL       0               /* backward compatibility */
---- ./tirpc/rpc/svc.h.orig     2014-11-28 09:16:53.992289976 +0000
-+++ ./tirpc/rpc/svc.h  2014-11-28 09:16:53.993289976 +0000
-@@ -202,11 +202,19 @@ struct svc_req {
-  *    const struct netconfig *nconf;
-  */
- 
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern bool_t svc_reg(SVCXPRT *, const rpcprog_t, const rpcvers_t,
-                       void (*)(struct svc_req *, SVCXPRT *),
-                       const struct netconfig *);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- /*
-  * Service un-registration
-@@ -216,9 +224,17 @@ __END_DECLS
-  *    const rpcvers_t vers;
-  */
- 
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern void   svc_unreg(const rpcprog_t, const rpcvers_t);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- /*
-  * Transport registration.
-@@ -226,9 +242,17 @@ __END_DECLS
-  * xprt_register(xprt)
-  *    SVCXPRT *xprt;
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern void   xprt_register(SVCXPRT *);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- /*
-  * Transport un-register
-@@ -236,9 +260,17 @@ __END_DECLS
-  * xprt_unregister(xprt)
-  *    SVCXPRT *xprt;
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern void   xprt_unregister(SVCXPRT *);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- 
- /*
-@@ -267,7 +299,11 @@ __END_DECLS
-  * deadlock the caller and server processes!
-  */
- 
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern bool_t svc_sendreply(SVCXPRT *, xdrproc_t, void *);
- extern void   svcerr_decode(SVCXPRT *);
- extern void   svcerr_weakauth(SVCXPRT *);
-@@ -279,7 +315,11 @@ extern void       svcerr_systemerr(SVCXPRT *);
- extern int    rpc_reg(rpcprog_t, rpcvers_t, rpcproc_t,
-                       char *(*)(char *), xdrproc_t, xdrproc_t,
-                       char *);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- /*
-  * Lowest level dispatching -OR- who owns this process anyway.
-@@ -308,11 +348,23 @@ extern int svc_fds;
-  * a small program implemented by the svc_rpc implementation itself;
-  * also see clnt.h for protocol numbers.
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern void rpctest_service(void);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern void   svc_getreq(int);
- extern void   svc_getreqset(fd_set *);
- extern void   svc_getreq_common(int);
-@@ -321,7 +373,11 @@ extern void       svc_getreq_poll(struct pollf
- 
- extern void   svc_run(void);
- extern void   svc_exit(void);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- /*
-  * Socket to use on svcxxx_create call to get default socket
-@@ -333,7 +389,11 @@ __END_DECLS
-  * These are the existing service side transport implementations
-  */
- 
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- /*
-  * Transport independent svc_create routine.
-  */
-@@ -429,7 +489,11 @@ int svc_dg_enablecache(SVCXPRT *, const
- 
- int __rpc_get_local_uid(SVCXPRT *_transp, uid_t *_uid);
- 
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- 
- /* for backward compatibility */
---- ./tirpc/rpc/rpc.h.orig     2014-11-28 09:16:53.994289976 +0000
-+++ ./tirpc/rpc/rpc.h  2014-11-28 09:16:53.994289976 +0000
-@@ -79,7 +79,11 @@
- #define UDPMSGSIZE 8800
- #endif
- 
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern int get_myaddress(struct sockaddr_in *);
- extern int bindresvport(int, struct sockaddr_in *) __THROW;
- extern int registerrpc(int, int, int, char *(*)(char [UDPMSGSIZE]),
-@@ -93,18 +97,30 @@ struct netbuf *uaddr2taddr(const struct
- 
- struct sockaddr;
- extern int bindresvport_sa(int, struct sockaddr *);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- /*
-  * The following are not exported interfaces, they are for internal library
-  * and rpcbind use only. Do not use, they may change without notice.
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- int __rpc_nconf2fd(const struct netconfig *);
- int __rpc_nconf2fd_flags(const struct netconfig *, int);
- int __rpc_nconf2sockinfo(const struct netconfig *, struct __rpc_sockinfo *);
- int __rpc_fd2sockinfo(int, struct __rpc_sockinfo *);
- u_int __rpc_get_t_size(int, int, int);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- #endif /* !_RPC_RPC_H */
---- ./tirpc/rpc/svc_soc.h.orig 2014-11-28 09:16:53.998289976 +0000
-+++ ./tirpc/rpc/svc_soc.h      2014-11-28 09:16:53.999289976 +0000
-@@ -66,10 +66,18 @@
-  *    void (*dispatch)();
-  *    int protocol;    like TCP or UDP, zero means do not register 
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern bool_t svc_register(SVCXPRT *, u_long, u_long,
-                   void (*)(struct svc_req *, SVCXPRT *), int);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- /*
-  * Service un-registration
-@@ -78,44 +86,84 @@ __END_DECLS
-  *    u_long prog;
-  *    u_long vers;
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern void   svc_unregister(u_long, u_long);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- 
- /*
-  * Memory based rpc for testing and timing.
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern SVCXPRT *svcraw_create(void);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- 
- /*
-  * Udp based rpc.
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern SVCXPRT *svcudp_create(int);
- extern SVCXPRT *svcudp_bufcreate(int, u_int, u_int);
- extern int svcudp_enablecache(SVCXPRT *, u_long);
- extern SVCXPRT *svcudp6_create(int);
- extern SVCXPRT *svcudp6_bufcreate(int, u_int, u_int);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- 
- /*
-  * Tcp based rpc.
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern SVCXPRT *svctcp_create(int, u_int, u_int);
- extern SVCXPRT *svctcp6_create(int, u_int, u_int);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- /*
-  * Fd based rpc.
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern SVCXPRT *svcfd_create(int, u_int, u_int);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- #endif /* !_RPC_SVC_SOC_H */
---- ./tirpc/rpc/clnt_soc.h.orig        2014-11-28 09:16:53.976289976 +0000
-+++ ./tirpc/rpc/clnt_soc.h     2014-11-28 09:16:53.977289976 +0000
-@@ -63,27 +63,51 @@
-  *    u_int sendsz;
-  *    u_int recvsz;
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern CLIENT *clnttcp_create(struct sockaddr_in *, u_long, u_long, int *,
-                             u_int, u_int);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- /*
-  * Raw (memory) rpc.
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern CLIENT *clntraw_create(u_long, u_long);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- 
- /*
- IPv6 socket version 
- */
- #ifdef INET6
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern CLIENT *clnttcp6_create(struct sockaddr_in6 *, u_long, u_long, int *,
-                             u_int, u_int);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- #endif
- 
- /*
-@@ -107,7 +131,11 @@ __END_DECLS
-  *    u_int sendsz;
-  *    u_int recvsz;
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern CLIENT *clntudp_create(struct sockaddr_in *, u_long, u_long, 
-                             struct timeval, int *);
- extern CLIENT *clntudp_bufcreate(struct sockaddr_in *, u_long, u_long,
-@@ -118,7 +146,11 @@ extern CLIENT *clntudp6_create(struct so
- extern CLIENT *clntudp6_bufcreate(struct sockaddr_in6 *, u_long, u_long,
-                                struct timeval, int *, u_int, u_int);
- #endif
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- 
- #endif /* _RPC_CLNT_SOC_H */
---- ./tirpc/rpc/rpc_com.h.orig 2014-11-28 09:16:53.977289976 +0000
-+++ ./tirpc/rpc/rpc_com.h      2014-11-28 09:16:53.978289976 +0000
-@@ -57,7 +57,11 @@
- #define __RPC_GETXID(now) ((u_int32_t)getpid() ^ (u_int32_t)(now)->tv_sec ^ \
-     (u_int32_t)(now)->tv_usec)
- 
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern u_int __rpc_get_a_size(int);
- extern int __rpc_dtbsize(void);
- extern int _rpc_dtablesize(void);
-@@ -79,6 +83,10 @@ bool_t rpc_control(int,void *);
- 
- char *_get_next_token(char *, int);
- 
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- #endif /* _RPC_RPCCOM_H */
---- ./tirpc/rpc/auth_unix.h.orig       2014-11-28 09:16:53.998289976 +0000
-+++ ./tirpc/rpc/auth_unix.h    2014-11-28 09:16:53.998289976 +0000
-@@ -69,9 +69,17 @@ struct authunix_parms {
- 
- #define authsys_parms authunix_parms
- 
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern bool_t xdr_authunix_parms(XDR *, struct authunix_parms *);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- /*
-  * If a response verifier has flavor AUTH_SHORT,
---- ./tirpc/rpc/pmap_rmt.h.orig        2014-11-28 09:16:53.986289976 +0000
-+++ ./tirpc/rpc/pmap_rmt.h     2014-11-28 09:16:53.986289976 +0000
-@@ -58,9 +58,17 @@ struct rmtcallres {
-       xdrproc_t xdr_results;
- };
- 
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern bool_t xdr_rmtcall_args(XDR *, struct rmtcallargs *);
- extern bool_t xdr_rmtcallres(XDR *, struct rmtcallres *);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- #endif /* !_RPC_PMAP_RMT_H */
---- ./tirpc/rpc/des_crypt.h.orig       2014-11-28 09:16:53.987289976 +0000
-+++ ./tirpc/rpc/des_crypt.h    2014-11-28 09:16:53.988289976 +0000
-@@ -85,23 +85,47 @@
- /*
-  * Cipher Block Chaining mode
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- int cbc_crypt( char *, char *, unsigned int, unsigned int, char *);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- /*
-  * Electronic Code Book mode
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- int ecb_crypt( char *, char *, unsigned int, unsigned int );
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- /* 
-  * Set des parity for a key.
-  * DES parity is odd and in the low bit of each byte
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- void des_setparity( char *);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- #endif  /* _DES_DES_CRYPT_H */
---- ./tirpc/rpc/rpcb_clnt.h.orig       2014-11-28 09:16:53.979289976 +0000
-+++ ./tirpc/rpc/rpcb_clnt.h    2014-11-28 09:16:53.979289976 +0000
-@@ -59,7 +59,11 @@
- 
- #include <rpc/types.h>
- #include <rpc/rpcb_prot.h>
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern bool_t rpcb_set(const rpcprog_t, const rpcvers_t,
-                      const struct netconfig  *, const struct netbuf *);
- extern bool_t rpcb_unset(const rpcprog_t, const rpcvers_t,
-@@ -78,6 +82,10 @@ extern bool_t rpcb_getaddr(const rpcprog
- extern bool_t rpcb_gettime(const char *, time_t *);
- extern char *rpcb_taddr2uaddr(struct netconfig *, struct netbuf *);
- extern struct netbuf *rpcb_uaddr2taddr(struct netconfig *, char *);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- #endif        /* !_RPC_RPCB_CLNT_H */
---- ./tirpc/rpc/clnt.h.orig    2014-11-28 09:16:53.984289976 +0000
-+++ ./tirpc/rpc/clnt.h 2014-11-28 09:16:53.985289976 +0000
-@@ -269,7 +269,11 @@ struct rpc_timers {
-  * Generic client creation routine. Supported protocols are those that
-  * belong to the nettype namespace (/etc/netconfig).
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern CLIENT *clnt_create(const char *, const rpcprog_t, const rpcvers_t,
-                          const char *);
- /*
-@@ -416,32 +420,60 @@ extern CLIENT *clnt_dg_create(const int,
-  */
- extern CLIENT *clnt_raw_create(rpcprog_t, rpcvers_t);
- 
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- 
- /*
-  * Print why creation failed
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern void clnt_pcreateerror(const char *);                  /* stderr */
- extern char *clnt_spcreateerror(const char *);                        /* 
string */
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- /*
-  * Like clnt_perror(), but is more verbose in its output
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern void clnt_perrno(enum clnt_stat);              /* stderr */
- extern char *clnt_sperrno(enum clnt_stat);            /* string */
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- /*
-  * Print an English error message, given the client error code
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern void clnt_perror(CLIENT *, const char *);              /* stderr */
- extern char *clnt_sperror(CLIENT *, const char *);            /* string */
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- 
- /*
-@@ -452,9 +484,17 @@ struct rpc_createerr {
-       struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */
- };
- 
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern struct rpc_createerr   *__rpc_createerr(void);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- #define get_rpc_createerr()   (*(__rpc_createerr()))
- #define rpc_createerr         (*(__rpc_createerr()))
- 
-@@ -471,12 +511,20 @@ __END_DECLS
-  *    char *out;
-  *    const char *nettype;
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern enum clnt_stat rpc_call(const char *, const rpcprog_t,
-                              const rpcvers_t, const rpcproc_t,
-                              const xdrproc_t, const char *,
-                              const xdrproc_t, char *, const char *);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- /*
-  * RPC broadcast interface
-@@ -524,7 +572,11 @@ __END_DECLS
- 
- typedef bool_t (*resultproc_t)(caddr_t, ...);
- 
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern enum clnt_stat rpc_broadcast(const rpcprog_t, const rpcvers_t,
-                                   const rpcproc_t, const xdrproc_t,
-                                   caddr_t, const xdrproc_t, caddr_t,
-@@ -534,7 +586,11 @@ extern enum clnt_stat rpc_broadcast_exp(
-                                       caddr_t, const xdrproc_t, caddr_t,
-                                       const resultproc_t, const int,
-                                       const int, const char *);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- /* For backward compatibility */
- #include <rpc/clnt_soc.h>
---- ./tirpc/rpc/rpcent.h.orig  2014-11-28 09:16:53.996289976 +0000
-+++ ./tirpc/rpc/rpcent.h       2014-11-28 09:16:53.996289976 +0000
-@@ -44,7 +44,11 @@
- /*    #pragma ident "@(#)rpcent.h   1.13    94/04/25 SMI"     */
- /*      @(#)rpcent.h 1.1 88/12/06 SMI   */
- 
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- 
- /* These are defined in /usr/include/rpc/netdb.h */
- #if 0
-@@ -62,6 +66,10 @@ extern struct rpcent *getrpcent(void);
- 
- extern void setrpcent(int) __THROW;
- extern void endrpcent(void) __THROW;
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- #endif /* !_RPC_CENT_H */
---- ./tirpc/rpc/pmap_clnt.h.orig       2014-11-28 09:16:53.980289976 +0000
-+++ ./tirpc/rpc/pmap_clnt.h    2014-11-28 09:16:53.980289976 +0000
-@@ -67,7 +67,11 @@
- #include <sys/cdefs.h>
- #endif
- 
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern bool_t         pmap_set(u_long, u_long, int, int);
- extern bool_t         pmap_unset(u_long, u_long);
- extern struct pmaplist        *pmap_getmaps(struct sockaddr_in *);
-@@ -82,6 +86,10 @@ extern enum clnt_stat       clnt_broadcast(u_l
-                                      resultproc_t);
- extern u_short                pmap_getport(struct sockaddr_in *,
-                                    u_long, u_long, u_int);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- #endif /* !_RPC_PMAP_CLNT_H_ */
---- ./tirpc/rpc/auth_gss.h.orig        2014-11-28 09:16:53.989289976 +0000
-+++ ./tirpc/rpc/auth_gss.h     2014-11-28 09:16:53.990289976 +0000
-@@ -104,7 +104,11 @@ struct rpc_gss_init_res {
- #define MAXSEQ                0x80000000
- 
- /* Prototypes. */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- bool_t        xdr_rpc_gss_cred        __P((XDR *xdrs, struct rpc_gss_cred 
*p));
- bool_t        xdr_rpc_gss_init_args   __P((XDR *xdrs, gss_buffer_desc *p));
- bool_t        xdr_rpc_gss_init_res    __P((XDR *xdrs, struct rpc_gss_init_res 
*p));
-@@ -126,6 +130,10 @@ void      gss_log_status          __P((char *m, OM_ui
-                                    OM_uint32 minor));
- void  gss_log_hexdump         __P((const u_char *buf, int len, int offset));
- 
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- #endif /* !_TIRPC_AUTH_GSS_H */
---- ./tirpc/rpc/rpc_msg.h.orig 2014-11-28 09:16:53.996289976 +0000
-+++ ./tirpc/rpc/rpc_msg.h      2014-11-28 09:16:53.997289976 +0000
-@@ -161,7 +161,11 @@ struct rpc_msg {
- #define       acpted_rply     ru.RM_rmb.ru.RP_ar
- #define       rjcted_rply     ru.RM_rmb.ru.RP_dr
- 
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- /*
-  * XDR routine to handle a rpc message.
-  * xdr_callmsg(xdrs, cmsg)
-@@ -210,6 +214,10 @@ extern bool_t     xdr_rejected_reply(XDR *,
-  *    struct rpc_err *error;
-  */
- extern void   _seterr_reply(struct rpc_msg *, struct rpc_err *);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- #endif /* !_TIRPC_RPC_MSG_H */
---- ./tirpc/rpc/nettype.h.orig 2014-11-28 09:16:53.981289976 +0000
-+++ ./tirpc/rpc/nettype.h      2014-11-28 09:16:53.982289976 +0000
-@@ -53,11 +53,19 @@
- #define       _RPC_TCP        7
- #define       _RPC_UDP        8
- 
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern void *__rpc_setconf(const char *);
- extern void __rpc_endconf(void *);
- extern struct netconfig *__rpc_getconf(void *);
- extern struct netconfig *__rpc_getconfip(const char *);
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- #endif        /* !_TIRPC_NETTYPE_H */
---- ./tirpc/rpc/svc_auth.h.orig        2014-11-28 09:16:53.986289976 +0000
-+++ ./tirpc/rpc/svc_auth.h     2014-11-28 09:16:53.987289976 +0000
-@@ -65,13 +65,21 @@ typedef struct SVCAUTH {
- /*
-  * Server side authenticator
-  */
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern enum auth_stat _gss_authenticate(struct svc_req *, struct rpc_msg *,
-               bool_t *);
- extern enum auth_stat _authenticate(struct svc_req *, struct rpc_msg *);
- extern int svc_auth_reg(int, enum auth_stat (*)(struct svc_req *,
-                         struct rpc_msg *));
- 
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- #endif /* !_RPC_SVC_AUTH_H */
---- ./tirpc/rpcsvc/nis.h.orig  2014-11-28 09:16:54.001289976 +0000
-+++ ./tirpc/rpcsvc/nis.h       2014-11-28 09:16:54.002289976 +0000
-@@ -36,7 +36,11 @@
- #include <rpc/rpc.h>
- #include <rpcsvc/nis_tags.h>
- 
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- 
- /*
-  *    nis.h
-@@ -611,6 +615,10 @@ extern  nis_error * nis_rmdir_3_svc (nis
- extern  nis_error * nis_updkeys_3 (nis_name *, CLIENT *) __THROW;
- extern  nis_error * nis_updkeys_3_svc (nis_name *, struct svc_req *) __THROW;
- 
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- #endif /* ! _RPCSVC_NIS_H */
---- ./tirpc/rpcsvc/nislib.h.orig       2014-11-28 09:16:53.999289976 +0000
-+++ ./tirpc/rpcsvc/nislib.h    2014-11-28 09:16:54.000289976 +0000
-@@ -23,7 +23,11 @@
- 
- #include <features.h>
- 
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- 
- typedef const char *const_nis_name;
- 
-@@ -283,6 +287,10 @@ extern nis_error __nisfind_server (const
- 
- #endif
- 
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- #endif        /* __RPCSVC_NISLIB_H__ */
---- ./tirpc/netconfig.h.orig   2014-11-28 09:16:54.003289976 +0000
-+++ ./tirpc/netconfig.h        2014-11-28 09:16:54.003289976 +0000
-@@ -74,7 +74,11 @@ typedef struct {
- #define NC_UDP                "udp"
- #define NC_ICMP               "icmp"
- 
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- 
- extern void *setnetconfig (void);
- extern struct netconfig *getnetconfig (void *);
-@@ -89,6 +93,10 @@ extern int endnetpath (void *);
- extern void nc_perror (const char *);
- extern char *nc_sperror (void);
- 
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- #endif /* _NETCONFIG_H_ */
---- ./src/rpc_com.h.orig       2014-11-28 09:16:53.975289976 +0000
-+++ ./src/rpc_com.h    2014-11-28 09:16:53.975289976 +0000
-@@ -56,7 +56,11 @@
- #define __RPC_GETXID(now) ((u_int32_t)getpid() ^ (u_int32_t)(now)->tv_sec ^ \
-     (u_int32_t)(now)->tv_usec)
- 
-+#ifdef __GLIBC__
- __BEGIN_DECLS
-+#elif defined(__cplusplus)
-+extern "C" {
-+#endif
- extern u_int __rpc_get_a_size(int);
- extern int __rpc_dtbsize(void);
- extern struct netconfig * __rpcgettp(int);
-@@ -92,6 +96,10 @@ void __xprt_set_raddr(SVCXPRT *, const s
- SVCXPRT **__svc_xports;
- int __svc_maxrec;
- 
-+#ifdef __GLIBC__
- __END_DECLS
-+#elif defined(__cplusplus)
-+}
-+#endif
- 
- #endif /* _TIRPC_RPCCOM_H */

diff --git a/net-libs/libtirpc/files/0005-fix_remaining_issues.patch 
b/net-libs/libtirpc/files/0005-fix_remaining_issues.patch
deleted file mode 100644
index 538e79e..0000000
--- a/net-libs/libtirpc/files/0005-fix_remaining_issues.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- ./tirpc/rpc/rpcent.h       2014-11-21 21:33:50.421928818 +0000
-+++ ./tirpc/rpc/rpcent.h       2014-11-21 21:35:05.140928818 +0000
-@@ -64,6 +64,10 @@ extern struct rpcent *getrpcbynumber(int
- extern struct rpcent *getrpcent(void);
- #endif
- 
-+#ifndef __GLIBC__
-+#define __THROW
-+#endif
-+
- extern void setrpcent(int) __THROW;
- extern void endrpcent(void) __THROW;
- #ifdef __GLIBC__
- 

diff --git a/net-libs/libtirpc/files/0007-no-des.patch 
b/net-libs/libtirpc/files/0007-no-des.patch
deleted file mode 100644
index 4347261..0000000
--- a/net-libs/libtirpc/files/0007-no-des.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- libtirpc-0.2.5.orig/src/Makefile.am
-+++ libtirpc-0.2.5/src/Makefile.am
-@@ -51,7 +51,7 @@
-         rpc_callmsg.c rpc_generic.c rpc_soc.c rpcb_clnt.c rpcb_prot.c \
-         rpcb_st_xdr.c svc.c svc_auth.c svc_dg.c svc_auth_unix.c 
svc_auth_none.c \
-         svc_generic.c svc_raw.c svc_run.c svc_simple.c svc_vc.c getpeereid.c \
--        auth_time.c auth_des.c authdes_prot.c debug.c
-+        auth_time.c debug.c
- 
- ## XDR
- libtirpc_la_SOURCES += xdr.c xdr_rec.c xdr_array.c xdr_float.c xdr_mem.c 
xdr_reference.c xdr_stdio.c
---- libtirpc-0.2.5.orig/src/rpc_soc.c
-+++ libtirpc-0.2.5/src/rpc_soc.c
-@@ -520,6 +520,7 @@
-           (resultproc_t) rpc_wrap_bcast, "udp");
- }
- 
-+#if 0
- /*
-  * Create the client des authentication object. Obsoleted by
-  * authdes_seccreate().
-@@ -551,6 +552,7 @@
-       dummy = authdes_seccreate(servername, window, NULL, ckey);
-       return (dummy);
- }
-+#endif
- 
- /*
-  * Create a client handle for a unix connection. Obsoleted by clnt_vc_create()

diff --git a/net-libs/libtirpc/files/git.patch 
b/net-libs/libtirpc/files/git.patch
deleted file mode 100644
index e458563..0000000
--- a/net-libs/libtirpc/files/git.patch
+++ /dev/null
@@ -1,842 +0,0 @@
-diff --git a/.gitignore b/.gitignore
-index b7814a3..ef97e01 100644
---- a/.gitignore
-+++ b/.gitignore
-@@ -34,6 +34,9 @@ libtirpc.pc
- lib*.a
- src/libtirpc.la
- src/libtirpc_la-*.lo
-+tirpc/stamp-h2
-+tirpc/tirpc-features.h
-+
- # generic editor backup et al
- *~
- .stgitmail.txt
-diff --git a/src/Makefile.am b/src/Makefile.am
-index e4ed8aa..fba2aa4 100644
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -24,7 +24,7 @@ libtirpc_la_SOURCES = auth_none.c auth_unix.c 
authunix_prot.c bindresvport.c cln
-         rpcb_st_xdr.c svc.c svc_auth.c svc_dg.c svc_auth_unix.c 
svc_auth_none.c \
-       svc_auth_des.c \
-         svc_generic.c svc_raw.c svc_run.c svc_simple.c svc_vc.c getpeereid.c \
--        auth_time.c auth_des.c authdes_prot.c debug.c
-+        auth_time.c auth_des.c authdes_prot.c debug.c des_crypt.c des_impl.c
- 
- ## XDR
- libtirpc_la_SOURCES += xdr.c xdr_rec.c xdr_array.c xdr_float.c xdr_mem.c 
xdr_reference.c xdr_stdio.c xdr_sizeof.c
-diff --git a/src/auth_des.c b/src/auth_des.c
-index 4d3639e..af2f61f 100644
---- a/src/auth_des.c
-+++ b/src/auth_des.c
-@@ -46,8 +46,8 @@
- #include <rpc/clnt.h>
- #include <rpc/xdr.h>
- #include <sys/socket.h>
--#undef NIS
--#include <rpcsvc/nis.h>
-+
-+#include "nis.h"
- 
- #if defined(LIBC_SCCS) && !defined(lint)
- #endif
-diff --git a/src/auth_gss.c b/src/auth_gss.c
-index 9b88c38..5959893 100644
---- a/src/auth_gss.c
-+++ b/src/auth_gss.c
-@@ -526,6 +526,14 @@ _rpc_gss_refresh(AUTH *auth, rpc_gss_options_ret_t 
*options_ret)
-                            gr.gr_major != GSS_S_CONTINUE_NEEDED)) {
-                               options_ret->major_status = gr.gr_major;
-                               options_ret->minor_status = gr.gr_minor;
-+                              if (call_stat != RPC_SUCCESS) {
-+                                      struct rpc_err err;
-+                                      clnt_geterr(gd->clnt, &err);
-+                                      LIBTIRPC_DEBUG(1, ("authgss_refresh: %s 
errno: %s",
-+                                              clnt_sperrno(call_stat), 
strerror(err.re_errno)));
-+                              } else
-+                                      gss_log_status("authgss_refresh:", 
-+                                              gr.gr_major, gr.gr_minor);
-                               return FALSE;
-                       }
- 
-diff --git a/src/auth_time.c b/src/auth_time.c
-index 10e58eb..7f83ab4 100644
---- a/src/auth_time.c
-+++ b/src/auth_time.c
-@@ -44,8 +44,8 @@
- #include <rpc/rpcb_prot.h>
- //#include <clnt_soc.h>
- #include <sys/select.h>
--#undef NIS
--#include <rpcsvc/nis.h>
-+
-+#include "nis.h"
- 
- 
- #ifdef TESTING
-diff --git a/src/clnt_vc.c b/src/clnt_vc.c
-index a72f9f7..a5fbe2f 100644
---- a/src/clnt_vc.c
-+++ b/src/clnt_vc.c
-@@ -72,6 +72,8 @@
- #define CMGROUP_MAX    16
- #define SCM_CREDS      0x03            /* process creds (struct cmsgcred) */
- 
-+#undef rpc_createerr                   /* make it clear it is a thread safe 
variable */
-+
- /*
-  * Credentials structure, used to verify the identity of a peer
-  * process that has sent us a message. This is allocated by the
-@@ -188,10 +190,11 @@ clnt_vc_create(fd, raddr, prog, vers, sendsz, recvsz)
-       cl = (CLIENT *)mem_alloc(sizeof (*cl));
-       ct = (struct ct_data *)mem_alloc(sizeof (*ct));
-       if ((cl == (CLIENT *)NULL) || (ct == (struct ct_data *)NULL)) {
-+              struct rpc_createerr *ce = &get_rpc_createerr();
-+              ce->cf_stat = RPC_SYSTEMERROR;
-+              ce->cf_error.re_errno = errno;
-               (void) syslog(LOG_ERR, clnt_vc_errstr,
-                   clnt_vc_str, __no_mem_str);
--              rpc_createerr.cf_stat = RPC_SYSTEMERROR;
--              rpc_createerr.cf_error.re_errno = errno;
-               goto err;
-       }
-       ct->ct_addr.buf = NULL;
-@@ -230,26 +233,29 @@ clnt_vc_create(fd, raddr, prog, vers, sendsz, recvsz)
-               assert(vc_cv != (cond_t *) NULL);
- 
-       /*
--       * XXX - fvdl connecting while holding a mutex?
-+       * Do not hold mutex during connect
-        */
-+      mutex_unlock(&clnt_fd_lock);
-+
-       slen = sizeof ss;
-       if (getpeername(fd, (struct sockaddr *)&ss, &slen) < 0) {
-               if (errno != ENOTCONN) {
--                      rpc_createerr.cf_stat = RPC_SYSTEMERROR;
--                      rpc_createerr.cf_error.re_errno = errno;
--                      mutex_unlock(&clnt_fd_lock);
-+                      struct rpc_createerr *ce = &get_rpc_createerr();
-+                      ce->cf_stat = RPC_SYSTEMERROR;
-+                      ce->cf_error.re_errno = errno;
-                       thr_sigsetmask(SIG_SETMASK, &(mask), NULL);
-                       goto err;
-               }
-               if (connect(fd, (struct sockaddr *)raddr->buf, raddr->len) < 0){
--                      rpc_createerr.cf_stat = RPC_SYSTEMERROR;
--                      rpc_createerr.cf_error.re_errno = errno;
--                      mutex_unlock(&clnt_fd_lock);
--                      thr_sigsetmask(SIG_SETMASK, &(mask), NULL);
--                      goto err;
-+                      if (errno != EISCONN) {
-+                              struct rpc_createerr *ce = &get_rpc_createerr();
-+                              ce->cf_stat = RPC_SYSTEMERROR;
-+                              ce->cf_error.re_errno = errno;
-+                              thr_sigsetmask(SIG_SETMASK, &(mask), NULL);
-+                              goto err;
-+                      }
-               }
-       }
--      mutex_unlock(&clnt_fd_lock);
-       if (!__rpc_fd2sockinfo(fd, &si))
-               goto err;
-       thr_sigsetmask(SIG_SETMASK, &(mask), NULL);
-diff --git a/src/des_impl.c b/src/des_impl.c
-index c5b7ed6..15bec2a 100644
---- a/src/des_impl.c
-+++ b/src/des_impl.c
-@@ -6,7 +6,8 @@
- /* see <http://www.gnu.org/licenses/> to obtain a copy.  */
- #include <string.h>
- #include <stdint.h>
--#include <rpc/rpc_des.h>
-+#include <sys/types.h>
-+#include <rpc/des.h>
- 
- 
- static const uint32_t des_SPtrans[8][64] =
-@@ -587,7 +588,7 @@ _des_crypt (char *buf, unsigned len, struct desparams 
*desp)
-     }
-   tin0 = tin1 = tout0 = tout1 = xor0 = xor1 = 0;
-   tbuf[0] = tbuf[1] = 0;
--  __bzero (schedule, sizeof (schedule));
-+  memset (schedule, 0, sizeof (schedule));
- 
-   return (1);
- }
-diff --git a/src/getpublickey.c b/src/getpublickey.c
-index 764a5f9..8cf4dc2 100644
---- a/src/getpublickey.c
-+++ b/src/getpublickey.c
-@@ -38,8 +38,10 @@
- #include <pwd.h>
- #include <rpc/rpc.h>
- #include <rpc/key_prot.h>
-+#ifdef YP
- #include <rpcsvc/yp_prot.h>
- #include <rpcsvc/ypclnt.h>
-+#endif
- #include <string.h>
- #include <stdlib.h>
- 
-diff --git a/src/getrpcport.c b/src/getrpcport.c
-index b452c99..c28cd61 100644
---- a/src/getrpcport.c
-+++ b/src/getrpcport.c
-@@ -57,8 +57,8 @@ getrpcport(host, prognum, versnum, proto)
-       memset(&addr, 0, sizeof(addr));
-       addr.sin_family = AF_INET;
-       addr.sin_port =  0;
--      if (hp->h_length > sizeof(addr))
--        hp->h_length = sizeof(addr);
-+      if (hp->h_length > sizeof(addr.sin_addr.s_addr))
-+              hp->h_length = sizeof(addr.sin_addr.s_addr);
-       memcpy(&addr.sin_addr.s_addr, hp->h_addr, (size_t)hp->h_length);
-       /* Inconsistent interfaces need casts! :-( */
-       return (pmap_getport(&addr, (u_long)prognum, (u_long)versnum, 
-diff --git a/src/nis.h b/src/nis.h
-new file mode 100644
-index 0000000..588c041
---- /dev/null
-+++ b/src/nis.h
-@@ -0,0 +1,70 @@
-+/*
-+ * Copyright (c) 2010, Oracle America, Inc.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions are
-+ * met:
-+ *
-+ *     * Redistributions of source code must retain the above copyright
-+ *       notice, this list of conditions and the following disclaimer.
-+ *     * Redistributions in binary form must reproduce the above
-+ *       copyright notice, this list of conditions and the following
-+ *       disclaimer in the documentation and/or other materials
-+ *       provided with the distribution.
-+ *     * Neither the name of the "Oracle America, Inc." nor the names of its
-+ *       contributors may be used to endorse or promote products derived
-+ *       from this software without specific prior written permission.
-+ *
-+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-+ *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-+ *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-+ *   COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-+ *   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+ *   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-+ *   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-+ *   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-+ *   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-+ *   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+ */
-+
-+#ifndef _INTERNAL_NIS_H
-+#define _INTERNAL_NIS_H 1
-+
-+/*  This file only contains the definition of nis_server, to be
-+    able to compile libtirpc without the need to have a glibc
-+    with sunrpc or a libnsl already installed. */
-+
-+#define NIS_PK_NONE 0
-+
-+struct nis_attr {
-+      char *zattr_ndx;
-+      struct {
-+              u_int zattr_val_len;
-+              char *zattr_val_val;
-+      } zattr_val;
-+};
-+typedef struct nis_attr nis_attr;
-+
-+typedef char *nis_name;
-+
-+struct endpoint {
-+      char *uaddr;
-+      char *family;
-+      char *proto;
-+};
-+typedef struct endpoint endpoint;
-+
-+struct nis_server {
-+      nis_name name;
-+      struct {
-+              u_int ep_len;
-+              endpoint *ep_val;
-+      } ep;
-+      uint32_t key_type;
-+      netobj pkey;
-+};
-+typedef struct nis_server nis_server;
-+
-+#endif /* ! _INTERNAL_NIS_H */
-diff --git a/src/rpc_dtablesize.c b/src/rpc_dtablesize.c
-index 13d320c..3fe503a 100644
---- a/src/rpc_dtablesize.c
-+++ b/src/rpc_dtablesize.c
-@@ -27,22 +27,14 @@
-  */
- 
- #include <unistd.h>
--
- #include <sys/select.h>
--
--int _rpc_dtablesize(void);    /* XXX */
-+#include <rpc/clnt.h>
-+#include <rpc/rpc_com.h>
- 
- /*
-  * Cache the result of getdtablesize(), so we don't have to do an
-  * expensive system call every time.
-  */
--/*
-- * XXX In FreeBSD 2.x, you can have the maximum number of open file
-- * descriptors be greater than FD_SETSIZE (which us 256 by default).
-- *
-- * Since old programs tend to use this call to determine the first arg
-- * for _select(), having this return > FD_SETSIZE is a Bad Idea(TM)!
-- */
- int
- _rpc_dtablesize(void)
- {
-diff --git a/src/rpc_soc.c b/src/rpc_soc.c
-index 1ec7b3f..ed0892a 100644
---- a/src/rpc_soc.c
-+++ b/src/rpc_soc.c
-@@ -61,8 +61,8 @@
- #include <string.h>
- #include <unistd.h>
- #include <fcntl.h>
--#include <rpcsvc/nis.h>
- 
-+#include "nis.h"
- #include "rpc_com.h"
- 
- extern mutex_t        rpcsoc_lock;
-diff --git a/src/rtime.c b/src/rtime.c
-index c34e0af..b642840 100644
---- a/src/rtime.c
-+++ b/src/rtime.c
-@@ -46,6 +46,7 @@
- #include <unistd.h>
- #include <errno.h>
- #include <sys/types.h>
-+#include <sys/poll.h>
- #include <sys/socket.h>
- #include <sys/time.h>
- #include <netinet/in.h>
-@@ -67,7 +68,8 @@ rtime(addrp, timep, timeout)
-       struct timeval *timeout;
- {
-       int s;
--      fd_set readfds;
-+      struct pollfd fd;
-+      int milliseconds;
-       int res;
-       unsigned long thetime;
-       struct sockaddr_in from;
-@@ -94,31 +96,32 @@ rtime(addrp, timep, timeout)
-       addrp->sin_port = serv->s_port;
- 
-       if (type == SOCK_DGRAM) {
--              res = sendto(s, (char *)&thetime, sizeof(thetime), 0, 
-+              res = sendto(s, (char *)&thetime, sizeof(thetime), 0,
-                            (struct sockaddr *)addrp, sizeof(*addrp));
-               if (res < 0) {
-                       do_close(s);
--                      return(-1);     
-+                      return(-1);
-               }
--              do {
--                      FD_ZERO(&readfds);
--                      FD_SET(s, &readfds);
--                      res = select(_rpc_dtablesize(), &readfds,
--                                   (fd_set *)NULL, (fd_set *)NULL, timeout);
--              } while (res < 0 && errno == EINTR);
-+
-+              milliseconds = (timeout->tv_sec * 1000) + (timeout->tv_usec / 
1000);
-+              fd.fd = s;
-+              fd.events = POLLIN;
-+              do
-+                res = poll (&fd, 1, milliseconds);
-+              while (res < 0 && errno == EINTR);
-               if (res <= 0) {
-                       if (res == 0) {
-                               errno = ETIMEDOUT;
-                       }
-                       do_close(s);
--                      return(-1);     
-+                      return(-1);
-               }
-               fromlen = sizeof(from);
--              res = recvfrom(s, (char *)&thetime, sizeof(thetime), 0, 
-+              res = recvfrom(s, (char *)&thetime, sizeof(thetime), 0,
-                              (struct sockaddr *)&from, &fromlen);
-               do_close(s);
-               if (res < 0) {
--                      return(-1);     
-+                      return(-1);
-               }
-       } else {
-               if (connect(s, (struct sockaddr *)addrp, sizeof(*addrp)) < 0) {
-diff --git a/src/svc.c b/src/svc.c
-index 9c41445..b59467b 100644
---- a/src/svc.c
-+++ b/src/svc.c
-@@ -99,7 +99,7 @@ xprt_register (xprt)
-     {
-       __svc_xports = (SVCXPRT **) calloc (_rpc_dtablesize(), sizeof (SVCXPRT 
*));
-       if (__svc_xports == NULL)
--      return;
-+            goto unlock;
-     }
-   if (sock < _rpc_dtablesize())
-     {
-@@ -120,14 +120,14 @@ xprt_register (xprt)
-             svc_pollfd[i].fd = sock;
-             svc_pollfd[i].events = (POLLIN | POLLPRI |
-                                     POLLRDNORM | POLLRDBAND);
--            return;
-+            goto unlock;
-           }
- 
-       new_svc_pollfd = (struct pollfd *) realloc (svc_pollfd,
-                                                   sizeof (struct pollfd)
-                                                   * (svc_max_pollfd + 1));
-       if (new_svc_pollfd == NULL) /* Out of memory */
--        return;
-+        goto unlock;
-       svc_pollfd = new_svc_pollfd;
-       ++svc_max_pollfd;
- 
-@@ -135,6 +135,7 @@ xprt_register (xprt)
-       svc_pollfd[svc_max_pollfd - 1].events = (POLLIN | POLLPRI |
-                                                POLLRDNORM | POLLRDBAND);
-     }
-+unlock:
-   rwlock_unlock (&svc_fd_lock);
- }
- 
-diff --git a/src/svc_auth_des.c b/src/svc_auth_des.c
-index 5bc264c..2e90146 100644
---- a/src/svc_auth_des.c
-+++ b/src/svc_auth_des.c
-@@ -86,13 +86,13 @@ static struct cache_entry *authdes_cache/* 
[AUTHDES_CACHESZ] */;
- static short *authdes_lru/* [AUTHDES_CACHESZ] */;
- 
- static void cache_init();     /* initialize the cache */
--static short cache_spot();    /* find an entry in the cache */
--static void cache_ref(/*short sid*/); /* note that sid was ref'd */
-+static short cache_spot(des_block *key, char *name, struct timeval 
*timestamp);  /* find an entry in the cache */
-+static void cache_ref(short sid);     /* note that sid was ref'd */
- 
--static void invalidate();     /* invalidate entry in cache */
-+static void invalidate(char *cred);   /* invalidate entry in cache */
- 
- /*
-- * cache statistics 
-+ * cache statistics
-  */
- static struct {
-       u_long ncachehits;      /* times cache hit, and is not replay */
-diff --git a/src/svc_auth_gss.c b/src/svc_auth_gss.c
-index b6aa407..bece46a 100644
---- a/src/svc_auth_gss.c
-+++ b/src/svc_auth_gss.c
-@@ -129,6 +129,8 @@ struct svc_rpc_gss_data {
-       ((struct svc_rpc_gss_data *)(auth)->svc_ah_private)
- 
- /* Global server credentials. */
-+static u_int          _svcauth_req_time = 0;
-+static gss_OID_set_desc       _svcauth_oid_set = {1, GSS_C_NULL_OID };
- static gss_cred_id_t  _svcauth_gss_creds;
- static gss_name_t     _svcauth_gss_name = GSS_C_NO_NAME;
- static char *         _svcauth_svc_name = NULL;
-@@ -167,6 +169,7 @@ svcauth_gss_import_name(char *service)
-       gss_name_t      name;
-       gss_buffer_desc namebuf;
-       OM_uint32       maj_stat, min_stat;
-+      bool_t          result;
- 
-       gss_log_debug("in svcauth_gss_import_name()");
- 
-@@ -181,22 +184,21 @@ svcauth_gss_import_name(char *service)
-                       maj_stat, min_stat);
-               return (FALSE);
-       }
--      if (svcauth_gss_set_svc_name(name) != TRUE) {
--              gss_release_name(&min_stat, &name);
--              return (FALSE);
--      }
--      return (TRUE);
-+      result = svcauth_gss_set_svc_name(name);
-+      gss_release_name(&min_stat, &name);
-+      return result;
- }
- 
- static bool_t
--svcauth_gss_acquire_cred(u_int req_time, gss_OID_set_desc *oid_set)
-+svcauth_gss_acquire_cred(void)
- {
-       OM_uint32       maj_stat, min_stat;
- 
-       gss_log_debug("in svcauth_gss_acquire_cred()");
- 
--      maj_stat = gss_acquire_cred(&min_stat, _svcauth_gss_name, req_time,
--                                  oid_set, GSS_C_ACCEPT,
-+      maj_stat = gss_acquire_cred(&min_stat, _svcauth_gss_name,
-+                                  _svcauth_req_time, &_svcauth_oid_set,
-+                                  GSS_C_ACCEPT,
-                                   &_svcauth_gss_creds, NULL, NULL);
- 
-       if (maj_stat != GSS_S_COMPLETE) {
-@@ -300,6 +302,8 @@ svcauth_gss_accept_sec_context(struct svc_req *rqst,
-                                             NULL,
-                                             &gd->deleg);
- 
-+      xdr_free((xdrproc_t)xdr_rpc_gss_init_args, (caddr_t)&recv_tok);
-+
-       if (gr->gr_major != GSS_S_COMPLETE &&
-           gr->gr_major != GSS_S_CONTINUE_NEEDED) {
-               gss_log_status("svcauth_gss_accept_sec_context: 
accept_sec_context",
-@@ -352,8 +356,11 @@ svcauth_gss_accept_sec_context(struct svc_req *rqst,
-                       return (FALSE);
- 
-               rqst->rq_xprt->xp_verf.oa_flavor = RPCSEC_GSS;
--              rqst->rq_xprt->xp_verf.oa_base = checksum.value;
-+              memcpy(rqst->rq_xprt->xp_verf.oa_base, checksum.value,
-+                      checksum.length);
-               rqst->rq_xprt->xp_verf.oa_length = checksum.length;
-+
-+              gss_release_buffer(&min_stat, &checksum);
-       }
-       return (TRUE);
- }
-@@ -435,10 +442,13 @@ svcauth_gss_nextverf(struct svc_req *rqst, u_int num)
-                       maj_stat, min_stat);
-               return (FALSE);
-       }
-+
-       rqst->rq_xprt->xp_verf.oa_flavor = RPCSEC_GSS;
--      rqst->rq_xprt->xp_verf.oa_base = (caddr_t)checksum.value;
-+      memcpy(rqst->rq_xprt->xp_verf.oa_base, checksum.value, checksum.length);
-       rqst->rq_xprt->xp_verf.oa_length = (u_int)checksum.length;
- 
-+      gss_release_buffer(&min_stat, &checksum);
-+
-       return (TRUE);
- }
- 
-@@ -568,6 +578,8 @@ _svcauth_gss(struct svc_req *rqst, struct rpc_msg *msg, 
bool_t *no_dispatch)
-       gss_qop_t                qop;
-       struct svcauth_gss_cache_entry **ce;
-       time_t                   now;
-+      enum auth_stat           result = AUTH_OK;
-+      OM_uint32                min_stat;
- 
-       gss_log_debug("in svcauth_gss()");
- 
-@@ -621,19 +633,25 @@ _svcauth_gss(struct svc_req *rqst, struct rpc_msg *msg, 
bool_t *no_dispatch)
-       XDR_DESTROY(&xdrs);
- 
-       /* Check version. */
--      if (gc->gc_v != RPCSEC_GSS_VERSION)
--              return (AUTH_BADCRED);
-+      if (gc->gc_v != RPCSEC_GSS_VERSION) {
-+              result = AUTH_BADCRED;
-+              goto out;
-+      }
- 
-       /* Check RPCSEC_GSS service. */
-       if (gc->gc_svc != RPCSEC_GSS_SVC_NONE &&
-           gc->gc_svc != RPCSEC_GSS_SVC_INTEGRITY &&
--          gc->gc_svc != RPCSEC_GSS_SVC_PRIVACY)
--              return (AUTH_BADCRED);
-+          gc->gc_svc != RPCSEC_GSS_SVC_PRIVACY) {
-+              result = AUTH_BADCRED;
-+              goto out;
-+      }
- 
-       /* Check sequence number. */
-       if (gd->established) {
--              if (gc->gc_seq > MAXSEQ)
--                      return (RPCSEC_GSS_CTXPROBLEM);
-+              if (gc->gc_seq > MAXSEQ) {
-+                      result = RPCSEC_GSS_CTXPROBLEM;
-+                      goto out;
-+              }
- 
-               if ((offset = gd->seqlast - gc->gc_seq) < 0) {
-                       gd->seqlast = gc->gc_seq;
-@@ -643,7 +661,8 @@ _svcauth_gss(struct svc_req *rqst, struct rpc_msg *msg, 
bool_t *no_dispatch)
-               }
-               else if (offset >= gd->win || (gd->seqmask & (1 << offset))) {
-                       *no_dispatch = 1;
--                      return (RPCSEC_GSS_CTXPROBLEM);
-+                      result = RPCSEC_GSS_CTXPROBLEM;
-+                      goto out;
-               }
-               gd->seq = gc->gc_seq;
-               gd->seqmask |= (1 << offset);
-@@ -654,35 +673,52 @@ _svcauth_gss(struct svc_req *rqst, struct rpc_msg *msg, 
bool_t *no_dispatch)
-               rqst->rq_svcname = (char *)gd->ctx;
-       }
- 
-+      rqst->rq_xprt->xp_verf.oa_base = msg->rm_call.cb_verf.oa_base;
-+
-       /* Handle RPCSEC_GSS control procedure. */
-       switch (gc->gc_proc) {
- 
-       case RPCSEC_GSS_INIT:
-       case RPCSEC_GSS_CONTINUE_INIT:
--              if (rqst->rq_proc != NULLPROC)
--                      return (AUTH_FAILED);           /* XXX ? */
-+              if (rqst->rq_proc != NULLPROC) {
-+                      result = AUTH_FAILED;           /* XXX ? */
-+                      break;
-+              }
- 
-               if (_svcauth_gss_name == GSS_C_NO_NAME) {
--                      if (!svcauth_gss_import_name("nfs"))
--                              return (AUTH_FAILED);
-+                      if (!svcauth_gss_import_name("nfs")) {
-+                              result = AUTH_FAILED;
-+                              break;
-+                      }
-               }
- 
--              if (!svcauth_gss_acquire_cred(0, GSS_C_NULL_OID_SET))
--                      return (AUTH_FAILED);
-+              if (!svcauth_gss_acquire_cred()) {
-+                      result = AUTH_FAILED;
-+                      break;
-+              }
- 
--              if (!svcauth_gss_accept_sec_context(rqst, &gr))
--                      return (AUTH_REJECTEDCRED);
-+              if (!svcauth_gss_accept_sec_context(rqst, &gr)) {
-+                      result = AUTH_REJECTEDCRED;
-+                      break;
-+              }
- 
--              if (!svcauth_gss_nextverf(rqst, htonl(gr.gr_win)))
--                      return (AUTH_FAILED);
-+              if (!svcauth_gss_nextverf(rqst, htonl(gr.gr_win))) {
-+                      result = AUTH_FAILED;
-+                      break;
-+              }
- 
-               *no_dispatch = TRUE;
- 
-               call_stat = svc_sendreply(rqst->rq_xprt, 
-                       (xdrproc_t)xdr_rpc_gss_init_res, (caddr_t)&gr);
- 
--              if (!call_stat)
--                      return (AUTH_FAILED);
-+              gss_release_buffer(&min_stat, &gr.gr_token);
-+              free(gr.gr_ctx.value);
-+
-+              if (!call_stat) {
-+                      result = AUTH_FAILED;
-+                      break;
-+              }
- 
-               if (gr.gr_major == GSS_S_COMPLETE)
-                       gd->established = TRUE;
-@@ -690,27 +726,37 @@ _svcauth_gss(struct svc_req *rqst, struct rpc_msg *msg, 
bool_t *no_dispatch)
-               break;
- 
-       case RPCSEC_GSS_DATA:
--              if (!svcauth_gss_validate(gd, msg, &qop))
--                      return (RPCSEC_GSS_CREDPROBLEM);
-+              if (!svcauth_gss_validate(gd, msg, &qop)) {
-+                      result = RPCSEC_GSS_CREDPROBLEM;
-+                      break;
-+              }
- 
--              if (!svcauth_gss_nextverf(rqst, htonl(gc->gc_seq)))
--                      return (AUTH_FAILED);
-+              if (!svcauth_gss_nextverf(rqst, htonl(gc->gc_seq))) {
-+                      result = AUTH_FAILED;
-+                      break;
-+              }
- 
-               if (!gd->callback_done) {
-                       gd->callback_done = TRUE;
-                       gd->sec.qop = qop;
-                       (void)rpc_gss_num_to_qop(gd->rcred.mechanism,
-                                               gd->sec.qop, &gd->rcred.qop);
--                      if (!svcauth_gss_callback(rqst, gd))
--                              return (AUTH_REJECTEDCRED);
-+                      if (!svcauth_gss_callback(rqst, gd)) {
-+                              result = AUTH_REJECTEDCRED;
-+                              break;
-+                      }
-               }
- 
-               if (gd->locked) {
-                       if (gd->rcred.service !=
--                                      _rpc_gss_svc_to_service(gc->gc_svc))
--                              return (AUTH_FAILED);
--                      if (gd->sec.qop != qop)
--                              return (AUTH_BADVERF);
-+                                      _rpc_gss_svc_to_service(gc->gc_svc)) {
-+                              result = AUTH_FAILED;
-+                              break;
-+                      }
-+                      if (gd->sec.qop != qop) {
-+                              result = AUTH_BADVERF;
-+                              break;
-+                      }
-               }
- 
-               if (gd->sec.qop != qop) {
-@@ -724,17 +770,25 @@ _svcauth_gss(struct svc_req *rqst, struct rpc_msg *msg, 
bool_t *no_dispatch)
-               break;
- 
-       case RPCSEC_GSS_DESTROY:
--              if (rqst->rq_proc != NULLPROC)
--                      return (AUTH_FAILED);           /* XXX ? */
-+              if (rqst->rq_proc != NULLPROC) {
-+                      result = AUTH_FAILED;           /* XXX ? */
-+                      break;
-+              }
- 
--              if (!svcauth_gss_validate(gd, msg, &qop))
--                      return (RPCSEC_GSS_CREDPROBLEM);
-+              if (!svcauth_gss_validate(gd, msg, &qop)) {
-+                      result = RPCSEC_GSS_CREDPROBLEM;
-+                      break;
-+              }
- 
--              if (!svcauth_gss_nextverf(rqst, htonl(gc->gc_seq)))
--                      return (AUTH_FAILED);
-+              if (!svcauth_gss_nextverf(rqst, htonl(gc->gc_seq))) {
-+                      result = AUTH_FAILED;
-+                      break;
-+              }
- 
--              if (!svcauth_gss_release_cred())
--                      return (AUTH_FAILED);
-+              if (!svcauth_gss_release_cred()) {
-+                      result = AUTH_FAILED;
-+                      break;
-+              }
- 
-               SVCAUTH_DESTROY(&SVC_XP_AUTH(rqst->rq_xprt));
-               SVC_XP_AUTH(rqst->rq_xprt).svc_ah_ops = 
svc_auth_none.svc_ah_ops;
-@@ -743,10 +797,12 @@ _svcauth_gss(struct svc_req *rqst, struct rpc_msg *msg, 
bool_t *no_dispatch)
-               break;
- 
-       default:
--              return (AUTH_REJECTEDCRED);
-+              result = AUTH_REJECTEDCRED;
-               break;
-       }
--      return (AUTH_OK);
-+out:
-+      xdr_free((xdrproc_t)xdr_rpc_gss_cred, (caddr_t)gc);
-+      return result;
- }
- 
- static bool_t
-@@ -890,7 +946,6 @@ bool_t
- rpc_gss_set_svc_name(char *principal, char *mechanism, u_int req_time,
-               u_int UNUSED(program), u_int UNUSED(version))
- {
--      gss_OID_set_desc oid_set;
-       rpc_gss_OID oid;
-       char *save;
- 
-@@ -902,14 +957,13 @@ rpc_gss_set_svc_name(char *principal, char *mechanism, 
u_int req_time,
- 
-       if (!rpc_gss_mech_to_oid(mechanism, &oid))
-               goto out_err;
--      oid_set.count = 1;
--      oid_set.elements = (gss_OID)oid;
- 
-       if (!svcauth_gss_import_name(principal))
-               goto out_err;
--      if (!svcauth_gss_acquire_cred(req_time, &oid_set))
--              goto out_err;
- 
-+      _svcauth_req_time = req_time;
-+      _svcauth_oid_set.count = 1;
-+      _svcauth_oid_set.elements = (gss_OID)oid;
-       free(_svcauth_svc_name);
-       _svcauth_svc_name = save;
-       return TRUE;
-diff --git a/src/svc_vc.c b/src/svc_vc.c
-index 6ae613d..97a76a3 100644
---- a/src/svc_vc.c
-+++ b/src/svc_vc.c
-@@ -270,14 +270,8 @@ makefd_xprt(fd, sendsize, recvsize)
-       struct cf_conn *cd;
-       const char *netid;
-       struct __rpc_sockinfo si;
-- 
--      assert(fd != -1);
- 
--        if (fd >= FD_SETSIZE) {
--                warnx("svc_vc: makefd_xprt: fd too high\n");
--                xprt = NULL;
--                goto done;
--        }
-+      assert(fd != -1);
- 
-       xprt = mem_alloc(sizeof(SVCXPRT));
-       if (xprt == NULL) {
-@@ -338,22 +332,10 @@ rendezvous_request(xprt, msg)
-       r = (struct cf_rendezvous *)xprt->xp_p1;
- again:
-       len = sizeof addr;
--      if ((sock = accept(xprt->xp_fd, (struct sockaddr *)(void *)&addr,
--          &len)) < 0) {
-+      sock = accept(xprt->xp_fd, (struct sockaddr *)(void *)&addr, &len);
-+      if (sock < 0) {
-               if (errno == EINTR)
-                       goto again;
--
--              if (errno == EMFILE || errno == ENFILE) {
--                /* If there are no file descriptors available, then accept 
will fail.
--                   We want to delay here so the connection request can be 
dequeued;
--                   otherwise we can bounce between polling and accepting, 
never
--                   giving the request a chance to dequeue and eating an 
enormous
--                   amount of cpu time in svc_run if we're polling on many file
--                   descriptors.  */
--                      struct timespec ts = { .tv_sec = 0, .tv_nsec = 50000000 
};
--                        nanosleep (&ts, NULL);
--                      goto again;
--              }
-               return (FALSE);
-       }
-       /*
-diff --git a/tirpc/rpc/des.h b/tirpc/rpc/des.h
-index d2881ad..018aa48 100644
---- a/tirpc/rpc/des.h
-+++ b/tirpc/rpc/des.h
-@@ -82,6 +82,6 @@ struct desparams {
- /*
-  * Software DES.
-  */
--extern int _des_crypt( char *, int, struct desparams * );
-+extern int _des_crypt( char *, unsigned, struct desparams * );
- 
- #endif
-diff --git a/tirpc/rpc/rpcent.h b/tirpc/rpc/rpcent.h
-index 147f909..e07503c 100644
---- a/tirpc/rpc/rpcent.h
-+++ b/tirpc/rpc/rpcent.h
-@@ -60,10 +60,11 @@ struct rpcent {
- extern struct rpcent *getrpcbyname(const char *);
- extern struct rpcent *getrpcbynumber(int);
- extern struct rpcent *getrpcent(void);
--#endif
- 
- extern void setrpcent(int);
- extern void endrpcent(void);
-+#endif
-+
- #ifdef __cplusplus
- }
- #endif

diff --git a/net-libs/libtirpc/files/libtirpc-0.2.5-stdarg.patch 
b/net-libs/libtirpc/files/libtirpc-0.2.5-stdarg.patch
deleted file mode 100644
index 8006de3..0000000
--- a/net-libs/libtirpc/files/libtirpc-0.2.5-stdarg.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From d26607bade0893fe8652e1a0983f9fae59c64649 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <[email protected]>
-Date: Tue, 12 Aug 2014 03:11:41 -0400
-Subject: [PATCH libtirpc] include stdarg.h when used
-
-The debug.h header uses va_list but doesn't include stdarg.h which
-can lead to random build failures.
-
-Signed-off-by: Mike Frysinger <[email protected]>
----
- src/debug.h | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/src/debug.h b/src/debug.h
-index afc8d57..c971ac3 100644
---- a/src/debug.h
-+++ b/src/debug.h
-@@ -21,6 +21,8 @@
- 
- #ifndef _DEBUG_H
- #define _DEBUG_H
-+
-+#include <stdarg.h>
- #include <syslog.h>
- 
- extern int libtirpc_debug_level;
--- 
-2.0.0
-

diff --git a/net-libs/libtirpc/files/libtirpc-1.0.1-CVE-2017-8779.patch 
b/net-libs/libtirpc/files/libtirpc-1.0.1-CVE-2017-8779.patch
deleted file mode 100644
index 91a50fa..0000000
--- a/net-libs/libtirpc/files/libtirpc-1.0.1-CVE-2017-8779.patch
+++ /dev/null
@@ -1,255 +0,0 @@
-diff --git a/src/rpc_generic.c b/src/rpc_generic.c
-index 2f09a8f..589cbd5 100644
---- a/src/rpc_generic.c
-+++ b/src/rpc_generic.c
-@@ -615,6 +615,9 @@ __rpc_taddr2uaddr_af(int af, const struct netbuf *nbuf)
- 
-       switch (af) {
-       case AF_INET:
-+              if (nbuf->len < sizeof(*sin)) {
-+                      return NULL;
-+              }
-               sin = nbuf->buf;
-               if (inet_ntop(af, &sin->sin_addr, namebuf, sizeof namebuf)
-                   == NULL)
-@@ -626,6 +629,9 @@ __rpc_taddr2uaddr_af(int af, const struct netbuf *nbuf)
-               break;
- #ifdef INET6
-       case AF_INET6:
-+              if (nbuf->len < sizeof(*sin6)) {
-+                      return NULL;
-+              }
-               sin6 = nbuf->buf;
-               if (inet_ntop(af, &sin6->sin6_addr, namebuf6, sizeof namebuf6)
-                   == NULL)
-@@ -667,6 +673,8 @@ __rpc_uaddr2taddr_af(int af, const char *uaddr)
- 
-       port = 0;
-       sin = NULL;
-+      if (uaddr == NULL)
-+              return NULL;
-       addrstr = strdup(uaddr);
-       if (addrstr == NULL)
-               return NULL;
-diff --git a/src/rpcb_prot.c b/src/rpcb_prot.c
-index 43fd385..a923c8e 100644
---- a/src/rpcb_prot.c
-+++ b/src/rpcb_prot.c
-@@ -41,6 +41,7 @@
- #include <rpc/types.h>
- #include <rpc/xdr.h>
- #include <rpc/rpcb_prot.h>
-+#include "rpc_com.h"
- 
- bool_t
- xdr_rpcb(xdrs, objp)
-@@ -53,13 +54,13 @@ xdr_rpcb(xdrs, objp)
-       if (!xdr_u_int32_t(xdrs, &objp->r_vers)) {
-               return (FALSE);
-       }
--      if (!xdr_string(xdrs, &objp->r_netid, (u_int)~0)) {
-+      if (!xdr_string(xdrs, &objp->r_netid, RPC_MAXDATASIZE)) {
-               return (FALSE);
-       }
--      if (!xdr_string(xdrs, &objp->r_addr, (u_int)~0)) {
-+      if (!xdr_string(xdrs, &objp->r_addr, RPC_MAXDATASIZE)) {
-               return (FALSE);
-       }
--      if (!xdr_string(xdrs, &objp->r_owner, (u_int)~0)) {
-+      if (!xdr_string(xdrs, &objp->r_owner, RPC_MAXDATASIZE)) {
-               return (FALSE);
-       }
-       return (TRUE);
-@@ -159,19 +160,19 @@ xdr_rpcb_entry(xdrs, objp)
-       XDR *xdrs;
-       rpcb_entry *objp;
- {
--      if (!xdr_string(xdrs, &objp->r_maddr, (u_int)~0)) {
-+      if (!xdr_string(xdrs, &objp->r_maddr, RPC_MAXDATASIZE)) {
-               return (FALSE);
-       }
--      if (!xdr_string(xdrs, &objp->r_nc_netid, (u_int)~0)) {
-+      if (!xdr_string(xdrs, &objp->r_nc_netid, RPC_MAXDATASIZE)) {
-               return (FALSE);
-       }
-       if (!xdr_u_int32_t(xdrs, &objp->r_nc_semantics)) {
-               return (FALSE);
-       }
--      if (!xdr_string(xdrs, &objp->r_nc_protofmly, (u_int)~0)) {
-+      if (!xdr_string(xdrs, &objp->r_nc_protofmly, RPC_MAXDATASIZE)) {
-               return (FALSE);
-       }
--      if (!xdr_string(xdrs, &objp->r_nc_proto, (u_int)~0)) {
-+      if (!xdr_string(xdrs, &objp->r_nc_proto, RPC_MAXDATASIZE)) {
-               return (FALSE);
-       }
-       return (TRUE);
-@@ -292,7 +293,7 @@ xdr_rpcb_rmtcallres(xdrs, p)
-       bool_t dummy;
-       struct r_rpcb_rmtcallres *objp = (struct r_rpcb_rmtcallres *)(void *)p;
- 
--      if (!xdr_string(xdrs, &objp->addr, (u_int)~0)) {
-+      if (!xdr_string(xdrs, &objp->addr, RPC_MAXDATASIZE)) {
-               return (FALSE);
-       }
-       if (!xdr_u_int(xdrs, &objp->results.results_len)) {
-@@ -312,6 +313,11 @@ xdr_netbuf(xdrs, objp)
-       if (!xdr_u_int32_t(xdrs, (u_int32_t *) &objp->maxlen)) {
-               return (FALSE);
-       }
-+
-+      if (objp->maxlen > RPC_MAXDATASIZE) {
-+              return (FALSE);
-+      }
-+
-       dummy = xdr_bytes(xdrs, (char **)&(objp->buf),
-                       (u_int *)&(objp->len), objp->maxlen);
-       return (dummy);
-diff --git a/src/rpcb_st_xdr.c b/src/rpcb_st_xdr.c
-index 08db745..28e6a48 100644
---- a/src/rpcb_st_xdr.c
-+++ b/src/rpcb_st_xdr.c
-@@ -37,6 +37,7 @@
- 
- 
- #include <rpc/rpc.h>
-+#include "rpc_com.h"
- 
- /* Link list of all the stats about getport and getaddr */
- 
-@@ -58,7 +59,7 @@ xdr_rpcbs_addrlist(xdrs, objp)
-           if (!xdr_int(xdrs, &objp->failure)) {
-               return (FALSE);
-           }
--          if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
-+          if (!xdr_string(xdrs, &objp->netid, RPC_MAXDATASIZE)) {
-               return (FALSE);
-           }
- 
-@@ -109,7 +110,7 @@ xdr_rpcbs_rmtcalllist(xdrs, objp)
-               IXDR_PUT_INT32(buf, objp->failure);
-               IXDR_PUT_INT32(buf, objp->indirect);
-       }
--      if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
-+      if (!xdr_string(xdrs, &objp->netid, RPC_MAXDATASIZE)) {
-               return (FALSE);
-       }
-       if (!xdr_pointer(xdrs, (char **)&objp->next,
-@@ -147,7 +148,7 @@ xdr_rpcbs_rmtcalllist(xdrs, objp)
-               objp->failure = (int)IXDR_GET_INT32(buf);
-               objp->indirect = (int)IXDR_GET_INT32(buf);
-       }
--      if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
-+      if (!xdr_string(xdrs, &objp->netid, RPC_MAXDATASIZE)) {
-               return (FALSE);
-       }
-       if (!xdr_pointer(xdrs, (char **)&objp->next,
-@@ -175,7 +176,7 @@ xdr_rpcbs_rmtcalllist(xdrs, objp)
-       if (!xdr_int(xdrs, &objp->indirect)) {
-               return (FALSE);
-       }
--      if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
-+      if (!xdr_string(xdrs, &objp->netid, RPC_MAXDATASIZE)) {
-               return (FALSE);
-       }
-       if (!xdr_pointer(xdrs, (char **)&objp->next,
-diff --git a/src/xdr.c b/src/xdr.c
-index f3fb9ad..b9a1558 100644
---- a/src/xdr.c
-+++ b/src/xdr.c
-@@ -42,8 +42,10 @@
- #include <stdlib.h>
- #include <string.h>
- 
-+#include <rpc/rpc.h>
- #include <rpc/types.h>
- #include <rpc/xdr.h>
-+#include <rpc/rpc_com.h>
- 
- typedef quad_t          longlong_t;     /* ANSI long long type */
- typedef u_quad_t        u_longlong_t;   /* ANSI unsigned long long type */
-@@ -53,7 +55,6 @@ typedef u_quad_t        u_longlong_t;   /* ANSI unsigned 
long long type */
-  */
- #define XDR_FALSE     ((long) 0)
- #define XDR_TRUE      ((long) 1)
--#define LASTUNSIGNED  ((u_int) 0-1)
- 
- /*
-  * for unit alignment
-@@ -629,6 +630,7 @@ xdr_bytes(xdrs, cpp, sizep, maxsize)
- {
-       char *sp = *cpp;  /* sp is the actual string pointer */
-       u_int nodesize;
-+      bool_t ret, allocated = FALSE;
- 
-       /*
-        * first deal with the length since xdr bytes are counted
-@@ -652,6 +654,7 @@ xdr_bytes(xdrs, cpp, sizep, maxsize)
-               }
-               if (sp == NULL) {
-                       *cpp = sp = mem_alloc(nodesize);
-+                      allocated = TRUE;
-               }
-               if (sp == NULL) {
-                       warnx("xdr_bytes: out of memory");
-@@ -660,7 +663,14 @@ xdr_bytes(xdrs, cpp, sizep, maxsize)
-               /* FALLTHROUGH */
- 
-       case XDR_ENCODE:
--              return (xdr_opaque(xdrs, sp, nodesize));
-+              ret = xdr_opaque(xdrs, sp, nodesize);
-+              if ((xdrs->x_op == XDR_DECODE) && (ret == FALSE)) {
-+                      if (allocated == TRUE) {
-+                              free(sp);
-+                              *cpp = NULL;
-+                      }
-+              }
-+              return (ret);
- 
-       case XDR_FREE:
-               if (sp != NULL) {
-@@ -754,6 +764,7 @@ xdr_string(xdrs, cpp, maxsize)
-       char *sp = *cpp;  /* sp is the actual string pointer */
-       u_int size;
-       u_int nodesize;
-+      bool_t ret, allocated = FALSE;
- 
-       /*
-        * first deal with the length since xdr strings are counted-strings
-@@ -793,8 +804,10 @@ xdr_string(xdrs, cpp, maxsize)
-       switch (xdrs->x_op) {
- 
-       case XDR_DECODE:
--              if (sp == NULL)
-+              if (sp == NULL) {
-                       *cpp = sp = mem_alloc(nodesize);
-+                      allocated = TRUE;
-+              }
-               if (sp == NULL) {
-                       warnx("xdr_string: out of memory");
-                       return (FALSE);
-@@ -803,7 +816,14 @@ xdr_string(xdrs, cpp, maxsize)
-               /* FALLTHROUGH */
- 
-       case XDR_ENCODE:
--              return (xdr_opaque(xdrs, sp, size));
-+              ret = xdr_opaque(xdrs, sp, size);
-+              if ((xdrs->x_op == XDR_DECODE) && (ret == FALSE)) {
-+                      if (allocated == TRUE) {
-+                              free(sp);
-+                              *cpp = NULL;
-+                      }
-+              }
-+              return (ret);
- 
-       case XDR_FREE:
-               mem_free(sp, nodesize);
-@@ -823,7 +843,7 @@ xdr_wrapstring(xdrs, cpp)
-       XDR *xdrs;
-       char **cpp;
- {
--      return xdr_string(xdrs, cpp, LASTUNSIGNED);
-+      return xdr_string(xdrs, cpp, RPC_MAXDATASIZE);
- }
- 
- /*

diff --git a/net-libs/libtirpc/files/libtirpc-1.0.2-bcopy-to-memmove.patch 
b/net-libs/libtirpc/files/libtirpc-1.0.2-bcopy-to-memmove.patch
new file mode 100644
index 0000000..91619b7
--- /dev/null
+++ b/net-libs/libtirpc/files/libtirpc-1.0.2-bcopy-to-memmove.patch
@@ -0,0 +1,49 @@
+diff -Naurp libtirpc-1.0.2.orig/src/auth_time.c libtirpc-1.0.2/src/auth_time.c
+--- libtirpc-1.0.2.orig/src/auth_time.c        2017-07-05 11:02:23.000000000 
-0400
++++ libtirpc-1.0.2/src/auth_time.c     2017-07-30 17:48:31.361420071 -0400
+@@ -104,7 +104,7 @@ static int uaddr_to_sockaddr(uaddr, sin)
+       p_bytes[1] = (unsigned char)a[5] & 0x000000FF;
+ 
+       sin->sin_family = AF_INET; /* always */
+-      bcopy((char *)&p_bytes, (char *)&sin->sin_port, 2);
++      memmove((char *)&sin->sin_port, (char *)&p_bytes, 2);
+ 
+       return (0);
+ }
+diff -Naurp libtirpc-1.0.2.orig/src/crypt_client.c 
libtirpc-1.0.2/src/crypt_client.c
+--- libtirpc-1.0.2.orig/src/crypt_client.c     2017-07-05 11:02:23.000000000 
-0400
++++ libtirpc-1.0.2/src/crypt_client.c  2017-07-30 17:49:57.911419445 -0400
+@@ -75,8 +75,8 @@ _des_crypt_call(buf, len, dparms)
+       des_crypt_1_arg.desbuf.desbuf_val = buf;
+       des_crypt_1_arg.des_dir = dparms->des_dir;
+       des_crypt_1_arg.des_mode = dparms->des_mode;
+-      bcopy(dparms->des_ivec, des_crypt_1_arg.des_ivec, 8);
+-      bcopy(dparms->des_key, des_crypt_1_arg.des_key, 8);
++      memmove(des_crypt_1_arg.des_ivec, dparms->des_ivec, 8);
++      memmove(des_crypt_1_arg.des_key, dparms->des_key, 8);
+ 
+       result_1 = des_crypt_1(&des_crypt_1_arg, clnt);
+       if (result_1 == (desresp *) NULL) {
+@@ -88,8 +88,8 @@ _des_crypt_call(buf, len, dparms)
+ 
+       if (result_1->stat == DESERR_NONE ||
+           result_1->stat == DESERR_NOHWDEVICE) {
+-              bcopy(result_1->desbuf.desbuf_val, buf, len);
+-              bcopy(result_1->des_ivec, dparms->des_ivec, 8);
++              memmove(buf, result_1->desbuf.desbuf_val, len);
++              memmove(dparms->des_ivec, result_1->des_ivec, 8);
+       }
+ 
+       clnt_freeres(clnt, (xdrproc_t)xdr_desresp, result_1);
+diff -Naurp libtirpc-1.0.2.orig/src/svc_auth_des.c 
libtirpc-1.0.2/src/svc_auth_des.c
+--- libtirpc-1.0.2.orig/src/svc_auth_des.c     2017-07-05 11:02:23.000000000 
-0400
++++ libtirpc-1.0.2/src/svc_auth_des.c  2017-07-30 17:50:36.591419165 -0400
+@@ -145,7 +145,7 @@ _svcauth_des(rqst, msg)
+                       return (AUTH_BADCRED);
+               }
+               cred->adc_fullname.name = area->area_netname;
+-              bcopy((char *)ixdr, cred->adc_fullname.name, 
++              memmove(cred->adc_fullname.name, (char *)ixdr,
+                       (u_int)namelen);
+               cred->adc_fullname.name[namelen] = 0;
+               ixdr += (RNDUP(namelen) / BYTES_PER_XDR_UNIT);

diff --git a/net-libs/libtirpc/files/libtirpc-1.0.2-bzero-to-memset.patch 
b/net-libs/libtirpc/files/libtirpc-1.0.2-bzero-to-memset.patch
new file mode 100644
index 0000000..64b516e
--- /dev/null
+++ b/net-libs/libtirpc/files/libtirpc-1.0.2-bzero-to-memset.patch
@@ -0,0 +1,36 @@
+diff -Naurp libtirpc-1.0.2.orig/src/auth_time.c libtirpc-1.0.2/src/auth_time.c
+--- libtirpc-1.0.2.orig/src/auth_time.c        2017-07-05 11:02:23.000000000 
-0400
++++ libtirpc-1.0.2/src/auth_time.c     2017-07-30 17:46:39.481420880 -0400
+@@ -317,7 +317,7 @@ __rpc_get_time_offset(td, srv, thost, ua
+       sprintf(ipuaddr, "%d.%d.%d.%d.0.111", a1, a2, a3, a4);
+       useua = &ipuaddr[0];
+ 
+-      bzero((char *)&sin, sizeof(sin));
++      memset((char *)&sin, 0, sizeof(sin));
+       if (uaddr_to_sockaddr(useua, &sin)) {
+               msg("unable to translate uaddr to sockaddr.");
+               if (needfree)
+diff -Naurp libtirpc-1.0.2.orig/src/des_impl.c libtirpc-1.0.2/src/des_impl.c
+--- libtirpc-1.0.2.orig/src/des_impl.c 2017-07-05 11:02:23.000000000 -0400
++++ libtirpc-1.0.2/src/des_impl.c      2017-07-30 17:46:49.581420807 -0400
+@@ -588,7 +588,7 @@ _des_crypt (char *buf, unsigned len, str
+     }
+   tin0 = tin1 = tout0 = tout1 = xor0 = xor1 = 0;
+   tbuf[0] = tbuf[1] = 0;
+-  __bzero (schedule, sizeof (schedule));
++  memset (schedule, 0, sizeof (schedule));
+ 
+   return (1);
+ }
+diff -Naurp libtirpc-1.0.2.orig/src/svc_auth_des.c 
libtirpc-1.0.2/src/svc_auth_des.c
+--- libtirpc-1.0.2.orig/src/svc_auth_des.c     2017-07-05 11:02:23.000000000 
-0400
++++ libtirpc-1.0.2/src/svc_auth_des.c  2017-07-30 17:46:58.771420741 -0400
+@@ -356,7 +356,7 @@ cache_init()
+ 
+       authdes_cache = (struct cache_entry *)
+               mem_alloc(sizeof(struct cache_entry) * AUTHDES_CACHESZ);        
+-      bzero((char *)authdes_cache, 
++      memset((char *)authdes_cache, 0,
+               sizeof(struct cache_entry) * AUTHDES_CACHESZ);
+ 
+       authdes_lru = (short *)mem_alloc(sizeof(short) * AUTHDES_CACHESZ);

diff --git a/net-libs/libtirpc/files/libtirpc-1.0.2-exports.patch 
b/net-libs/libtirpc/files/libtirpc-1.0.2-exports.patch
new file mode 100644
index 0000000..174f4e3
--- /dev/null
+++ b/net-libs/libtirpc/files/libtirpc-1.0.2-exports.patch
@@ -0,0 +1,17 @@
+See
+https://bugs.alpinelinux.org/issues/7041
+https://git.alpinelinux.org/cgit/aports/commit/?id=9edb53cea056101c4963a04b747bf102de23f919
+(just hit this myself when building libnsl)
+... dilfridge
+
+--- a/src/libtirpc.map
++++ b/src/libtirpc.map
+@@ -298,7 +298,7 @@
+     key_gendes;
+     key_get_conv;
+     key_setsecret;
+-    key_secret_is_set;
++    key_secretkey_is_set;
+     key_setnet;
+     netname2host;
+     netname2user;

diff --git a/net-libs/libtirpc/files/libtirpc-1.0.2-glibc-2.26.patch 
b/net-libs/libtirpc/files/libtirpc-1.0.2-glibc-2.26.patch
new file mode 100644
index 0000000..6d583e6
--- /dev/null
+++ b/net-libs/libtirpc/files/libtirpc-1.0.2-glibc-2.26.patch
@@ -0,0 +1,12 @@
+diff --git a/src/xdr_sizeof.c b/src/xdr_sizeof.c
+index d23fbd1..79d6707 100644
+--- a/src/xdr_sizeof.c
++++ b/src/xdr_sizeof.c
+@@ -39,6 +39,7 @@
+ #include <rpc/xdr.h>
+ #include <sys/types.h>
+ #include <stdlib.h>
++#include <stdint.h>
+ #include "un-namespace.h"
+ 
+ /* ARGSUSED */

diff --git a/net-libs/libtirpc/libtirpc-0.2.5.ebuild 
b/net-libs/libtirpc/libtirpc-0.2.5.ebuild
deleted file mode 100644
index fa28963..0000000
--- a/net-libs/libtirpc/libtirpc-0.2.5.ebuild
+++ /dev/null
@@ -1,73 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="4"
-
-inherit multilib-minimal toolchain-funcs autotools
-
-DESCRIPTION="Transport Independent RPC library (SunRPC replacement)"
-HOMEPAGE="http://libtirpc.sourceforge.net/";
-SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2
-       mirror://gentoo/${PN}-glibc-nfs.tar.xz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 sh sparc x86"
-IUSE="ipv6 kerberos static-libs"
-
-RDEPEND="kerberos? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] )"
-DEPEND="${RDEPEND}
-       elibc_musl? ( sys-libs/queue )
-       app-arch/xz-utils
-       >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]"
-RDEPEND="${RDEPEND}
-       abi_x86_32? (
-               !<=app-emulation/emul-linux-x86-baselibs-20140508-r7
-               !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
-       )"
-
-src_unpack() {
-       unpack ${A}
-       cp -r tirpc "${S}"/ || die
-}
-
-src_prepare() {
-       epatch "${FILESDIR}"/${P}-stdarg.patch
-       epatch 
"${FILESDIR}"/0001-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
-       epatch "${FILESDIR}"/0002-Misc-header-fixes.patch
-       epatch "${FILESDIR}"/0003-fix_cdefs_h_include.patch
-       epatch "${FILESDIR}"/0004-fix_DECLS.patch
-       epatch "${FILESDIR}"/0005-fix_remaining_issues.patch
-       epatch "${FILESDIR}"/0007-no-des.patch
-       eautoconf
-       eautoreconf
-}
-
-multilib_src_configure() {
-       ECONF_SOURCE=${S} \
-       econf \
-               $(use_enable ipv6) \
-               $(use_enable kerberos gssapi) \
-               $(use_enable static-libs static)
-}
-
-multilib_src_install() {
-       default
-
-       # libtirpc replaces rpc support in glibc, so we need it in /
-       gen_usr_ldscript -a tirpc
-}
-
-multilib_src_install_all() {
-       einstalldocs
-
-       insinto /etc
-       doins doc/netconfig
-
-       insinto /usr/include/tirpc
-       doins -r "${WORKDIR}"/tirpc/*
-
-       # makes sure that the linking order for nfs-utils is proper, as
-       # libtool would inject a libgssglue dependency in the list.
-       use static-libs || prune_libtool_files
-}

diff --git a/net-libs/libtirpc/libtirpc-1.0.1-r1.ebuild 
b/net-libs/libtirpc/libtirpc-1.0.2-r1.ebuild
similarity index 81%
rename from net-libs/libtirpc/libtirpc-1.0.1-r1.ebuild
rename to net-libs/libtirpc/libtirpc-1.0.2-r1.ebuild
index dea23ff..cb5ecc2 100644
--- a/net-libs/libtirpc/libtirpc-1.0.1-r1.ebuild
+++ b/net-libs/libtirpc/libtirpc-1.0.2-r1.ebuild
@@ -3,7 +3,7 @@
 
 EAPI="5"
 
-inherit multilib-minimal toolchain-funcs eutils
+inherit autotools multilib-minimal toolchain-funcs eutils
 
 DESCRIPTION="Transport Independent RPC library (SunRPC replacement)"
 HOMEPAGE="http://libtirpc.sourceforge.net/";
@@ -12,7 +12,7 @@ SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2
 
 LICENSE="GPL-2"
 SLOT="0/3" # subslot matches SONAME major
-KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86"
+KEYWORDS="amd64 arm ~mips ppc x86"
 IUSE="ipv6 kerberos static-libs"
 
 RDEPEND="kerberos? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] )"
@@ -22,15 +22,17 @@ DEPEND="${RDEPEND}
        >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]"
 
 PATCHES=(
-       "${FILESDIR}/${P}-CVE-2017-8779.patch"
-       # musl fixes
-       "${FILESDIR}"/git.patch
+       "${FILESDIR}/${PN}-1.0.2-bcopy-to-memmove.patch"
+       "${FILESDIR}/${PN}-1.0.2-bzero-to-memset.patch"
+       "${FILESDIR}/${PN}-1.0.2-glibc-2.26.patch"
+       "${FILESDIR}/${PN}-1.0.2-exports.patch"
 )
 
 src_prepare() {
        cp -r "${WORKDIR}"/tirpc "${S}"/ || die
        epatch "${PATCHES[@]}"
        epatch_user
+       eautoreconf
 }
 
 multilib_src_configure() {

Reply via email to