All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Smolorz <sebastian.smolorz@gmx.de>
To: xenomai@xenomai.org
Subject: [PATCH v2 2/8] net/tcp: fix listen() and shutdown() IOCTL calls
Date: Tue,  6 Nov 2018 11:00:20 +0100	[thread overview]
Message-ID: <1541498426-2916-3-git-send-email-sebastian.smolorz@gmx.de> (raw)
In-Reply-To: <1541498426-2916-1-git-send-email-sebastian.smolorz@gmx.de>

listen() and shutdown() pass their simple int argument directly casted to
void *arg, not as a pointer to their value.

Signed-off-by: Sebastian Smolorz <sebastian.smolorz@gmx.de>
---
 kernel/drivers/net/stack/ipv4/tcp/tcp.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/kernel/drivers/net/stack/ipv4/tcp/tcp.c b/kernel/drivers/net/stack/ipv4/tcp/tcp.c
index c713635..8605a8c 100644
--- a/kernel/drivers/net/stack/ipv4/tcp/tcp.c
+++ b/kernel/drivers/net/stack/ipv4/tcp/tcp.c
@@ -1790,8 +1790,6 @@ static int rt_tcp_ioctl(struct rtdm_fd *fd,
     struct _rtdm_getsockopt_args _getopt;
     const struct _rtdm_setsockopt_args *setopt;
     struct _rtdm_setsockopt_args _setopt;
-    const long *val;
-    long _val;
     int in_rt;
 
     /* fast path for common socket IOCTLs */
@@ -1815,10 +1813,7 @@ static int rt_tcp_ioctl(struct rtdm_fd *fd,
 		return rt_tcp_connect(ts, setaddr->addr, setaddr->addrlen);
 
 	case _RTIOC_LISTEN:
-		val = rtnet_get_arg(fd, &_val, arg, sizeof(long));
-		if (IS_ERR(val))
-			return PTR_ERR(val);
-		return rt_tcp_listen(ts, *val);
+		return rt_tcp_listen(ts, (unsigned long)arg);
 
 	case _RTIOC_ACCEPT:
 		if (!in_rt)
@@ -1829,10 +1824,7 @@ static int rt_tcp_ioctl(struct rtdm_fd *fd,
 		return rt_tcp_accept(ts, getaddr->addr, getaddr->addrlen);
 
 	case _RTIOC_SHUTDOWN:
-		val = rtnet_get_arg(fd, &_val, arg, sizeof(long));
-		if (IS_ERR(val))
-			return PTR_ERR(val);
-		return rt_tcp_shutdown(ts, *val);
+		return rt_tcp_shutdown(ts, (unsigned long)arg);
 
 	case _RTIOC_SETSOCKOPT:
 		setopt = rtnet_get_arg(fd, &_setopt, arg, sizeof(_setopt));
-- 
2.7.4



  parent reply	other threads:[~2018-11-06 10:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06 10:00 [PATCH v2 0/8] net/tcp: Fix several bugs and allow rttcp to be built Sebastian Smolorz
2018-11-06 10:00 ` [PATCH v2 1/8] net/tcp: return ufd in rt_tcp_accept() Sebastian Smolorz
2018-11-06 10:00 ` Sebastian Smolorz [this message]
2018-11-06 10:00 ` [PATCH v2 3/8] net/tcp: Fix bug when obtaining RST socket's private structure from its rtdm_fd pointer Sebastian Smolorz
2018-11-06 10:00 ` [PATCH v2 4/8] net/tcp: Copy data back to user buffer in rt_tcp_recvmsg Sebastian Smolorz
2018-11-06 18:52   ` Jan Kiszka
2018-11-08  8:09     ` Sebastian Smolorz
2018-11-06 10:00 ` [PATCH v2 5/8] net/tcp: fix TCP connection termination Sebastian Smolorz
2018-11-06 10:00 ` [PATCH v2 6/8] net/tcp: Set valid flags in struct tcphdr on little and big endian machines Sebastian Smolorz
2018-11-06 10:00 ` [PATCH v2 7/8] net/tcp: return already copied number of bytes to recv() callers when peer socket terminates Sebastian Smolorz
2018-11-06 10:00 ` [PATCH v2 8/8] net/tcp: Allow choice of rttcp protocol in Kconfig Sebastian Smolorz
2018-11-16  6:28 ` [PATCH v2 0/8] net/tcp: Fix several bugs and allow rttcp to be built Jan Kiszka

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=1541498426-2916-3-git-send-email-sebastian.smolorz@gmx.de \
    --to=sebastian.smolorz@gmx.de \
    --cc=xenomai@xenomai.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.