mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-17 01:47:31 +08:00
Update to FreeBSD head 2017-08-01
Git mirror commit f5002f5e5f78cae9f0269d812dc0aedb0339312c. Update #3472.
This commit is contained in:
@@ -694,7 +694,7 @@ static struct netconfig *
|
||||
dup_ncp(struct netconfig *ncp)
|
||||
{
|
||||
struct netconfig *p;
|
||||
char *tmp, *tmp2;
|
||||
char *tmp;
|
||||
u_int i;
|
||||
|
||||
if ((tmp=malloc(MAXNETCONFIGLINE)) == NULL)
|
||||
@@ -703,7 +703,6 @@ dup_ncp(struct netconfig *ncp)
|
||||
free(tmp);
|
||||
return(NULL);
|
||||
}
|
||||
tmp2 = tmp;
|
||||
/*
|
||||
* First we dup all the data from matched netconfig buffer. Then we
|
||||
* adjust some of the member pointer to a pre-allocated buffer where
|
||||
@@ -725,7 +724,6 @@ dup_ncp(struct netconfig *ncp)
|
||||
if (p->nc_lookups == NULL) {
|
||||
free(p->nc_netid);
|
||||
free(p);
|
||||
free(tmp2);
|
||||
return(NULL);
|
||||
}
|
||||
for (i=0; i < p->nc_nlookups; i++) {
|
||||
|
@@ -611,6 +611,8 @@ __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)
|
||||
@@ -622,6 +624,8 @@ __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)
|
||||
@@ -660,6 +664,10 @@ __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;
|
||||
|
@@ -500,14 +500,15 @@ try_nconf:
|
||||
hostname = IN6_LOCALHOST_STRING;
|
||||
}
|
||||
}
|
||||
endnetconfig(nc_handle);
|
||||
if (tmpnconf == NULL) {
|
||||
endnetconfig(nc_handle);
|
||||
rpc_createerr.cf_stat = RPC_UNKNOWNPROTO;
|
||||
mutex_unlock(&loopnconf_lock);
|
||||
return (NULL);
|
||||
}
|
||||
loopnconf = getnetconfigent(tmpnconf->nc_netid);
|
||||
/* loopnconf is never freed */
|
||||
endnetconfig(nc_handle);
|
||||
}
|
||||
mutex_unlock(&loopnconf_lock);
|
||||
client = getclnthandle(hostname, loopnconf, NULL);
|
||||
|
@@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <rpc/types.h>
|
||||
#include <rpc/xdr.h>
|
||||
#include <rpc/rpcb_prot.h>
|
||||
#include <rpc/rpc_com.h>
|
||||
#include "un-namespace.h"
|
||||
|
||||
bool_t
|
||||
@@ -64,13 +65,13 @@ xdr_rpcb(XDR *xdrs, RPCB *objp)
|
||||
if (!xdr_rpcvers(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);
|
||||
@@ -164,19 +165,19 @@ xdr_rpcblist(XDR *xdrs, RPCBLIST **rp)
|
||||
bool_t
|
||||
xdr_rpcb_entry(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);
|
||||
@@ -291,7 +292,7 @@ xdr_rpcb_rmtcallres(XDR *xdrs, struct rpcb_rmtcallres *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)) {
|
||||
|
@@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include "namespace.h"
|
||||
#include <rpc/rpc.h>
|
||||
#include <rpc/rpc_com.h>
|
||||
#include "un-namespace.h"
|
||||
|
||||
/* Link list of all the stats about getport and getaddr */
|
||||
@@ -65,7 +66,7 @@ xdr_rpcbs_addrlist(XDR *xdrs, rpcbs_addrlist *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);
|
||||
}
|
||||
|
||||
@@ -117,7 +118,7 @@ xdr_rpcbs_rmtcalllist(XDR *xdrs, rpcbs_rmtcalllist *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);
|
||||
}
|
||||
pnext = &objp->next;
|
||||
@@ -156,7 +157,7 @@ xdr_rpcbs_rmtcalllist(XDR *xdrs, rpcbs_rmtcalllist *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 **) pnext,
|
||||
@@ -184,7 +185,7 @@ xdr_rpcbs_rmtcalllist(XDR *xdrs, rpcbs_rmtcalllist *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 **) pnext,
|
||||
|
Reference in New Issue
Block a user