Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147859772
D20409.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D20409.diff
View Options
Index: head/sys/compat/linux/linux_socket.c
===================================================================
--- head/sys/compat/linux/linux_socket.c
+++ head/sys/compat/linux/linux_socket.c
@@ -939,11 +939,13 @@
struct iovec *iov;
socklen_t datalen;
struct sockaddr *sa;
+ struct socket *so;
sa_family_t sa_family;
+ struct file *fp;
void *data;
l_size_t len;
l_size_t clen;
- int error;
+ int error, fflag;
error = copyin(msghdr, &linux_msg, sizeof(linux_msg));
if (error != 0)
@@ -974,12 +976,30 @@
control = NULL;
- if (linux_msg.msg_controllen >= sizeof(struct l_cmsghdr)) {
- error = kern_getsockname(td, s, &sa, &datalen);
+ error = kern_getsockname(td, s, &sa, &datalen);
+ if (error != 0)
+ goto bad;
+ sa_family = sa->sa_family;
+ free(sa, M_SONAME);
+
+ if (flags & LINUX_MSG_OOB) {
+ error = EOPNOTSUPP;
+ if (sa_family == AF_UNIX)
+ goto bad;
+
+ error = getsock_cap(td, s, &cap_send_rights, &fp,
+ &fflag, NULL);
if (error != 0)
goto bad;
- sa_family = sa->sa_family;
- free(sa, M_SONAME);
+ so = fp->f_data;
+ if (so->so_type != SOCK_STREAM)
+ error = EOPNOTSUPP;
+ fdrop(fp, td);
+ if (error != 0)
+ goto bad;
+ }
+
+ if (linux_msg.msg_controllen >= sizeof(struct l_cmsghdr)) {
error = ENOBUFS;
control = m_get(M_WAITOK, MT_CONTROL);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 15, 6:06 AM (8 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29704760
Default Alt Text
D20409.diff (1 KB)
Attached To
Mode
D20409: Linux does not support MSG_OOB for unix(7) or not-stream oriented socket
Attached
Detach File
Event Timeline
Log In to Comment