All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linux-kernel@vger.kernel.org
Cc: David Miller <davem@davemloft.net>,
	Christoph Hellwig <hch@lst.de>,
	netdev@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>
Subject: [PATCH 4/7] appletalk: handle SIOCATALKDIFADDR compat ioctl
Date: Fri,  6 Nov 2009 19:09:06 +0100	[thread overview]
Message-ID: <1257530949-9695-5-git-send-email-arnd@arndb.de> (raw)
In-Reply-To: <1257530949-9695-1-git-send-email-arnd@arndb.de>

We must not have a compat ioctl handler for SIOCATALKDIFADDR
in common code, because the same number is used in other protocols
with different data structures.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/compat_ioctl.c   |    1 -
 net/appletalk/ddp.c |   12 +++++++-----
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index f4a5a01..50d2a5f 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -2536,7 +2536,6 @@ HANDLE_IOCTL(SIOCSIFHWBROADCAST, dev_ifsioc)
 HANDLE_IOCTL(SIOCSHWTSTAMP, dev_ifsioc)
 
 /* ioctls used by appletalk ddp.c */
-HANDLE_IOCTL(SIOCATALKDIFADDR, dev_ifsioc)
 HANDLE_IOCTL(SIOCDIFADDR, dev_ifsioc)
 HANDLE_IOCTL(SIOCSARP, dev_ifsioc)
 HANDLE_IOCTL(SIOCDARP, dev_ifsioc)
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index b1a4290..db9c75a 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -1810,12 +1810,14 @@ static int atalk_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 static int atalk_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 {
 	/*
-	 * All Appletalk ioctls except SIOCATALKDIFADDR are standard.  And
-	 * SIOCATALKDIFADDR is handled by upper layer as well, so there is
-	 * nothing to do.  Eventually SIOCATALKDIFADDR should be moved
-	 * here so there is no generic SIOCPROTOPRIVATE translation in the
-	 * system.
+	 * SIOCATALKDIFADDR is a SIOCPROTOPRIVATE ioctl number, so we
+	 * cannot handle it in common code. The data we access if ifreq
+	 * here is compatible, so we can simply call the native
+	 * handler.
 	 */
+	if (cmd == SIOCATALKDIFADDR)
+		return atalk_ioctl(sock, cmd, (unsigned long)compat_ptr(arg));
+
 	return -ENOIOCTLCMD;
 }
 #endif
-- 
1.6.3.3


  parent reply	other threads:[~2009-11-06 18:09 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-06 18:09 [RFC, PATCH 0/7] net, compat_ioctl: move handlers to net/socket.c Arnd Bergmann
2009-11-06 18:09 ` Arnd Bergmann
2009-11-06 18:09 ` [PATCH 1/7] compat: add struct compat_ifreq etc to compat.h Arnd Bergmann
2009-11-06 18:17   ` Daniel Walker
2009-11-06 18:09 ` [PATCH 2/7] net/tun: handle compat_ioctl directly Arnd Bergmann
2009-11-06 18:09 ` [PATCH 3/7] net, compat_ioctl: handle socket ioctl abuses in tty drivers Arnd Bergmann
2009-11-06 18:09 ` Arnd Bergmann [this message]
2009-11-06 18:09 ` [PATCH 5/7] copy socket ioctl code to net/socket.h Arnd Bergmann
2009-11-06 18:09 ` [PATCH 6/7] compat: move sockios handling to net/socket.c Arnd Bergmann
2009-11-06 18:09 ` [PATCH 7/7] net, compat_ioctl: handle more ioctls correctly Arnd Bergmann
2009-11-07  4:47 ` [RFC, PATCH 0/7] net, compat_ioctl: move handlers to net/socket.c David Miller
2009-11-08 21:31   ` Arnd Bergmann
2009-11-08 21:34     ` [PATCH 1/2] net, compat_ioctl: fix SIOCGMII ioctls Arnd Bergmann
2009-11-09  4:56       ` David Miller
2009-11-08 21:39     ` [PATCH 2/2] net/compat_ioctl: support SIOCWANDEV Arnd Bergmann
2009-11-09  4:57       ` David Miller
2009-11-09 14:48       ` Krzysztof Halasa
2009-11-09  4:55     ` [RFC, PATCH 0/7] net, compat_ioctl: move handlers to net/socket.c David Miller

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=1257530949-9695-5-git-send-email-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.