Netdev List
 help / color / mirror / Atom feed
* recvmsg compat code
@ 2003-03-13 19:24 Anton Blanchard
  0 siblings, 0 replies; only message in thread
From: Anton Blanchard @ 2003-03-13 19:24 UTC (permalink / raw)
  To: netdev; +Cc: davem, akpm, bcrl


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))

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-03-13 19:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-13 19:24 recvmsg compat code Anton Blanchard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox