From: Anton Blanchard <anton@samba.org>
To: netdev@oss.sgi.com
Cc: davem@redhat.com, akpm@digeo.com, bcrl@redhat.com
Subject: recvmsg compat code
Date: Fri, 14 Mar 2003 06:24:57 +1100 [thread overview]
Message-ID: <20030313192457.GA3279@krispykreme> (raw)
Hi,
The recent clean up of the duplicated recvmsg code (which I was happy to
see go in) broke my sshd.
It turns out compat handling of fd passing is broken. We were looking
for the MSG_CMSG_COMPAT flag in msg->msg_flags. I was just about to pass
down flags into the two problem functions, however put_cmsg is called
from a bunch of places.
Any thoughts?
Anton
===== net/core/scm.c 1.6 vs edited =====
--- 1.6/net/core/scm.c Fri Mar 7 06:06:44 2003
+++ edited/net/core/scm.c Fri Mar 14 06:18:03 2003
@@ -165,14 +165,15 @@
return err;
}
-int put_cmsg(struct msghdr * msg, int level, int type, int len, void *data)
+int put_cmsg(struct msghdr * msg, int level, int type, int len, void *data,
+ unsigned int flags)
{
struct cmsghdr *cm = (struct cmsghdr*)msg->msg_control;
struct cmsghdr cmhdr;
int cmlen = CMSG_LEN(len);
int err;
- if (MSG_CMSG_COMPAT & msg->msg_flags)
+ if (MSG_CMSG_COMPAT & flags)
return put_cmsg_compat(msg, level, type, len, data);
if (cm==NULL || msg->msg_controllen < sizeof(*cm)) {
@@ -200,7 +201,8 @@
return err;
}
-void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm)
+void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm,
+ unsigned long flags)
{
struct cmsghdr *cm = (struct cmsghdr*)msg->msg_control;
@@ -210,7 +212,7 @@
int *cmfptr;
int err = 0, i;
- if (MSG_CMSG_COMPAT & msg->msg_flags)
+ if (MSG_CMSG_COMPAT & flags)
return scm_detach_fds_compat(msg, scm);
if (msg->msg_controllen > sizeof(struct cmsghdr))
reply other threads:[~2003-03-13 19:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030313192457.GA3279@krispykreme \
--to=anton@samba.org \
--cc=akpm@digeo.com \
--cc=bcrl@redhat.com \
--cc=davem@redhat.com \
--cc=netdev@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).