svn commit: r364700 - stable/12/sys/compat/linux
Edward Tomasz Napierala
trasz at FreeBSD.org
Mon Aug 24 16:00:59 UTC 2020
Author: trasz
Date: Mon Aug 24 16:00:58 2020
New Revision: 364700
URL: https://svnweb.freebsd.org/changeset/base/364700
Log:
MFC r362103:
Fix naming clash.
Sponsored by: The FreeBSD Foundation
Modified:
stable/12/sys/compat/linux/linux_socket.c
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/sys/compat/linux/linux_socket.c
==============================================================================
--- stable/12/sys/compat/linux/linux_socket.c Mon Aug 24 15:56:31 2020 (r364699)
+++ stable/12/sys/compat/linux/linux_socket.c Mon Aug 24 16:00:58 2020 (r364700)
@@ -942,7 +942,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc
struct msghdr msg;
struct l_cmsghdr linux_cmsg;
struct l_cmsghdr *ptr_cmsg;
- struct l_msghdr linux_msg;
+ struct l_msghdr linux_msghdr;
struct iovec *iov;
socklen_t datalen;
struct sockaddr *sa;
@@ -954,7 +954,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc
l_size_t clen;
int error, fflag;
- error = copyin(msghdr, &linux_msg, sizeof(linux_msg));
+ error = copyin(msghdr, &linux_msghdr, sizeof(linux_msghdr));
if (error != 0)
return (error);
@@ -965,10 +965,11 @@ linux_sendmsg_common(struct thread *td, l_int s, struc
* order to handle this case. This should be checked, but allows the
* Linux ping to work.
*/
- if (PTRIN(linux_msg.msg_control) != NULL && linux_msg.msg_controllen == 0)
- linux_msg.msg_control = PTROUT(NULL);
+ if (PTRIN(linux_msghdr.msg_control) != NULL &&
+ linux_msghdr.msg_controllen == 0)
+ linux_msghdr.msg_control = PTROUT(NULL);
- error = linux_to_bsd_msghdr(&msg, &linux_msg);
+ error = linux_to_bsd_msghdr(&msg, &linux_msghdr);
if (error != 0)
return (error);
@@ -1006,7 +1007,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc
goto bad;
}
- if (linux_msg.msg_controllen >= sizeof(struct l_cmsghdr)) {
+ if (linux_msghdr.msg_controllen >= sizeof(struct l_cmsghdr)) {
error = ENOBUFS;
control = m_get(M_WAITOK, MT_CONTROL);
@@ -1014,8 +1015,8 @@ linux_sendmsg_common(struct thread *td, l_int s, struc
data = mtod(control, void *);
datalen = 0;
- ptr_cmsg = PTRIN(linux_msg.msg_control);
- clen = linux_msg.msg_controllen;
+ ptr_cmsg = PTRIN(linux_msghdr.msg_control);
+ clen = linux_msghdr.msg_controllen;
do {
error = copyin(ptr_cmsg, &linux_cmsg,
sizeof(struct l_cmsghdr));
@@ -1150,7 +1151,7 @@ linux_recvmsg_common(struct thread *td, l_int s, struc
struct l_cmsghdr *linux_cmsg = NULL;
struct l_ucred linux_ucred;
socklen_t datalen, maxlen, outlen;
- struct l_msghdr linux_msg;
+ struct l_msghdr linux_msghdr;
struct iovec *iov, *uiov;
struct mbuf *control = NULL;
struct mbuf **controlp;
@@ -1162,11 +1163,11 @@ linux_recvmsg_common(struct thread *td, l_int s, struc
void *data;
int error, i, fd, fds, *fdp;
- error = copyin(msghdr, &linux_msg, sizeof(linux_msg));
+ error = copyin(msghdr, &linux_msghdr, sizeof(linux_msghdr));
if (error != 0)
return (error);
- error = linux_to_bsd_msghdr(msg, &linux_msg);
+ error = linux_to_bsd_msghdr(msg, &linux_msghdr);
if (error != 0)
return (error);
@@ -1194,7 +1195,7 @@ linux_recvmsg_common(struct thread *td, l_int s, struc
goto bad;
if (msg->msg_name) {
- msg->msg_name = PTRIN(linux_msg.msg_name);
+ msg->msg_name = PTRIN(linux_msghdr.msg_name);
error = bsd_to_linux_sockaddr(sa, &lsa, msg->msg_namelen);
if (error == 0)
error = copyout(lsa, PTRIN(msg->msg_name),
@@ -1204,12 +1205,12 @@ linux_recvmsg_common(struct thread *td, l_int s, struc
goto bad;
}
- error = bsd_to_linux_msghdr(msg, &linux_msg);
+ error = bsd_to_linux_msghdr(msg, &linux_msghdr);
if (error != 0)
goto bad;
- maxlen = linux_msg.msg_controllen;
- linux_msg.msg_controllen = 0;
+ maxlen = linux_msghdr.msg_controllen;
+ linux_msghdr.msg_controllen = 0;
if (control) {
linux_cmsg = malloc(L_CMSG_HDRSZ, M_LINUX, M_WAITOK | M_ZERO);
@@ -1217,7 +1218,7 @@ linux_recvmsg_common(struct thread *td, l_int s, struc
msg->msg_controllen = control->m_len;
cm = CMSG_FIRSTHDR(msg);
- outbuf = PTRIN(linux_msg.msg_control);
+ outbuf = PTRIN(linux_msghdr.msg_control);
outlen = 0;
while (cm != NULL) {
linux_cmsg->cmsg_type =
@@ -1283,7 +1284,7 @@ linux_recvmsg_common(struct thread *td, l_int s, struc
error = EMSGSIZE;
goto bad;
} else {
- linux_msg.msg_flags |= LINUX_MSG_CTRUNC;
+ linux_msghdr.msg_flags |= LINUX_MSG_CTRUNC;
m_dispose_extcontrolm(control);
goto out;
}
@@ -1305,11 +1306,11 @@ linux_recvmsg_common(struct thread *td, l_int s, struc
cm = CMSG_NXTHDR(msg, cm);
}
- linux_msg.msg_controllen = outlen;
+ linux_msghdr.msg_controllen = outlen;
}
out:
- error = copyout(&linux_msg, msghdr, sizeof(linux_msg));
+ error = copyout(&linux_msghdr, msghdr, sizeof(linux_msghdr));
bad:
if (control != NULL) {
@@ -1687,7 +1688,7 @@ linux_socketcall(struct thread *td, struct linux_socke
return (linux_sendmmsg(td, arg));
}
- uprintf("LINUX: 'socket' typ=%d not implemented\n", args->what);
+ linux_msg(td, "socket type %d not implemented", args->what);
return (ENOSYS);
}
#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
More information about the svn-src-all
mailing list