mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-14 22:56:25 +08:00
Update to FreeBSD head 2018-04-01
Git mirror commit 8dfb1ccc26d1cea7e2529303003ff61f9f1784c4. Update #3472.
This commit is contained in:
@@ -409,6 +409,8 @@ int __sys_futimens(int fd, const struct timespec *times) __hidden;
|
||||
int __sys_utimensat(int fd, const char *path,
|
||||
const struct timespec *times, int flag) __hidden;
|
||||
|
||||
__size_t __arc4_sysctl(unsigned char *, __size_t);
|
||||
|
||||
/* execve() with PATH processing to implement posix_spawnp() */
|
||||
int _execvpe(const char *, char * const *, char * const *);
|
||||
|
||||
|
@@ -126,26 +126,36 @@ getnameinfo(const struct sockaddr *sa, socklen_t salen,
|
||||
afd = find_afd(sa->sa_family);
|
||||
if (afd == NULL)
|
||||
return (EAI_FAMILY);
|
||||
/*
|
||||
* getnameinfo() accepts an salen of sizeof(struct sockaddr_storage)
|
||||
* at maximum as shown in RFC 4038 Sec.6.2.3.
|
||||
*/
|
||||
if (salen > sizeof(struct sockaddr_storage))
|
||||
return (EAI_FAMILY);
|
||||
|
||||
switch (sa->sa_family) {
|
||||
case PF_LOCAL:
|
||||
/*
|
||||
* PF_LOCAL uses variable sa->sa_len depending on the
|
||||
* PF_LOCAL uses variable salen depending on the
|
||||
* content length of sun_path. Require 1 byte in
|
||||
* sun_path at least.
|
||||
*/
|
||||
if (salen > afd->a_socklen ||
|
||||
salen <= afd->a_socklen -
|
||||
if (salen <= afd->a_socklen -
|
||||
sizeofmember(struct sockaddr_un, sun_path))
|
||||
return (EAI_FAIL);
|
||||
return (EAI_FAMILY);
|
||||
else if (salen > afd->a_socklen)
|
||||
salen = afd->a_socklen;
|
||||
break;
|
||||
case PF_LINK:
|
||||
if (salen <= afd->a_socklen -
|
||||
sizeofmember(struct sockaddr_dl, sdl_data))
|
||||
return (EAI_FAIL);
|
||||
return (EAI_FAMILY);
|
||||
break;
|
||||
default:
|
||||
if (salen != afd->a_socklen)
|
||||
return (EAI_FAIL);
|
||||
if (salen < afd->a_socklen)
|
||||
return (EAI_FAMILY);
|
||||
else
|
||||
salen = afd->a_socklen;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -519,7 +529,7 @@ getnameinfo_un(const struct afd *afd,
|
||||
if (serv != NULL && servlen > 0)
|
||||
*serv = '\0';
|
||||
if (host != NULL && hostlen > 0) {
|
||||
pathlen = sa->sa_len - afd->a_off;
|
||||
pathlen = salen - afd->a_off;
|
||||
|
||||
if (pathlen + 1 > hostlen) {
|
||||
*host = '\0';
|
||||
|
@@ -70,7 +70,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include "rpc_com.h"
|
||||
#include "mt_misc.h"
|
||||
|
||||
#define su_data(xprt) ((struct svc_dg_data *)(xprt->xp_p2))
|
||||
#define su_data(xprt) ((struct svc_dg_data *)((xprt)->xp_p2))
|
||||
#define rpc_buffer(xprt) ((xprt)->xp_p1)
|
||||
|
||||
#ifndef MAX
|
||||
|
Reference in New Issue
Block a user