[PATCH v2] net/tcp: Account for connection teardown handshake

2019-09-20 Thread Sebastian Smolorz via Xenomai
When closing a TCP connection a handshake procedure is executed between the peers. The close routine of the rttcp driver did not participate in detecting the end of this handshake but rather waited one second inside a close call unconditionally. Especially when peers are directly connected this is

Re: [PATCH] net/tcp: Account for connection teardown handshake

2019-09-18 Thread Sebastian Smolorz via Xenomai
On 17.09.19 14:46, Jan Kiszka wrote: > On 17.09.19 14:01, Sebastian Smolorz wrote: > > When closing a TCP connection a handshake procedure is executed between the > > peers. The close routine of the rttcp driver did not participate in > > detecting the end of this handshake but rather waited one

[PATCH] net/tcp: Account for connection teardown handshake

2019-09-17 Thread Sebastian Smolorz via Xenomai
When closing a TCP connection a handshake procedure is executed between the peers. The close routine of the rttcp driver did not participate in detecting the end of this handshake but rather waited one second inside a close call unconditionally. Especially when peers are directly connected this is

Re: Finalizing 3.1, finally

2019-09-13 Thread Sebastian Smolorz via Xenomai
Hi Jan, Jan Kiszka wrote: > we are postponing this for too long now, so I'd like to make step towards a > feature freeze for 3.1, marked by an -rc1, and then a release. So, everyone > sitting on API- or even ABI-breaking changes should speak up now. This week I have improved the close behaviour

[PATCH] net/ip_sock: ioctl: fix unsafe accesses from/to userspace

2019-06-06 Thread Sebastian Smolorz via Xenomai
Signed-off-by: Sebastian Smolorz --- kernel/drivers/net/stack/ipv4/ip_sock.c | 127 1 file changed, 88 insertions(+), 39 deletions(-) diff --git a/kernel/drivers/net/stack/ipv4/ip_sock.c b/kernel/drivers/net/stack/ipv4/ip_sock.c index 20f27feff..1ae3a9eeb 100644 ---

Re: RTnet bind failed socket again

2019-06-04 Thread Sebastian Smolorz via Xenomai
Hi, on 04.06.2019 09:45, Per Oberg wrote: > - Den 3 jun 2019, på kl 17:33, Jan Kiszka jan.kis...@siemens.com skrev: > > > On 03.06.19 11:10, Per Oberg via Xenomai wrote: > > > > > > - Den 3 jun 2019, på kl 11:06, xenomai xenomai@xenomai.org skrev: > > > >> Hi, > > > >> My program

[PATCH v2] net/tcp: fix unsafe accesses from/to userspace

2019-06-03 Thread Sebastian Smolorz via Xenomai
Signed-off-by: Sebastian Smolorz --- kernel/drivers/net/stack/ipv4/tcp/tcp.c | 90 - 1 file changed, 59 insertions(+), 31 deletions(-) diff --git a/kernel/drivers/net/stack/ipv4/tcp/tcp.c b/kernel/drivers/net/stack/ipv4/tcp/tcp.c index 828f7d115..f4ea6ffcc 100644 ---

Re: [PATCH] net/tcp: fix unsafe accesses from/to userspace

2019-06-01 Thread Sebastian Smolorz via Xenomai
Hi Jan, On 29.05.19 19:17, Jan Kiszka wrote: > On 28.05.19 16:05, Sebastian Smolorz wrote: > > Signed-off-by: Sebastian Smolorz > > --- > > kernel/drivers/net/stack/ipv4/tcp/tcp.c | 91 - > > 1 file changed, 60 insertions(+), 31 deletions(-) > > > > diff --git

[PATCH] net/tcp: fix unsafe accesses from/to userspace

2019-05-28 Thread Sebastian Smolorz via Xenomai
Signed-off-by: Sebastian Smolorz --- kernel/drivers/net/stack/ipv4/tcp/tcp.c | 91 - 1 file changed, 60 insertions(+), 31 deletions(-) diff --git a/kernel/drivers/net/stack/ipv4/tcp/tcp.c b/kernel/drivers/net/stack/ipv4/tcp/tcp.c index 828f7d115..4803165f4 100644 ---

Re: [PATCH v2 4/8] net/tcp: Copy data back to user buffer in rt_tcp_recvmsg

2018-11-08 Thread Sebastian Smolorz via Xenomai
On 06.11.18, 19:52, Jan Kiszka wrote: > On 06.11.18 11:00, Sebastian Smolorz via Xenomai wrote: > > A bug in rt_tcp_recvmsg() prevented an application to receive data > > over an RTTCP socket. Data was not copied back to the application's > > buffer but rather into a te

Re: [PATCH 0/4] net/tcp: Fix several bugs and allow rttcp to be built

2018-11-06 Thread Sebastian Smolorz via Xenomai
Hi Phong, Pham, Phong wrote: > Hi Sebastian, > > Your patch (fixing TCP flags endianness issue) does work. Great, thanks for testing. -- Sebastian > (I was > under the impression to use tcp_flag_word and fix it in > rt_tcp_set_flags() which I reported doesn't work earlier.) > Phong. > >

Re: [PATCH 0/4] net/tcp: Fix several bugs and allow rttcp to be built

2018-11-06 Thread Sebastian Smolorz via Xenomai
Hi Phong, Sebastian Smolorz wrote: > Pham, Phong wrote: > > Hi Sebastian, > > > > " Phong, can you test this on your machine?" > > No the fix does not work. It overwrites the window field. > > Did you try the patch I sent here? > >

[PATCH v2 4/8] net/tcp: Copy data back to user buffer in rt_tcp_recvmsg

2018-11-06 Thread Sebastian Smolorz via Xenomai
A bug in rt_tcp_recvmsg() prevented an application to receive data over an RTTCP socket. Data was not copied back to the application's buffer but rather into a temporary kernel buffer. Signed-off-by: Sebastian Smolorz --- kernel/drivers/net/stack/ipv4/tcp/tcp.c | 13 +++-- 1 file

[PATCH v2 8/8] net/tcp: Allow choice of rttcp protocol in Kconfig

2018-11-06 Thread Sebastian Smolorz via Xenomai
Signed-off-by: Sebastian Smolorz --- kernel/drivers/net/stack/ipv4/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/drivers/net/stack/ipv4/Kconfig b/kernel/drivers/net/stack/ipv4/Kconfig index fef7e19..8fb3c1a 100644 --- a/kernel/drivers/net/stack/ipv4/Kconfig

[PATCH v2 2/8] net/tcp: fix listen() and shutdown() IOCTL calls

2018-11-06 Thread Sebastian Smolorz via Xenomai
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 --- kernel/drivers/net/stack/ipv4/tcp/tcp.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git

[PATCH v2 6/8] net/tcp: Set valid flags in struct tcphdr on little and big endian machines

2018-11-06 Thread Sebastian Smolorz via Xenomai
Setting TCP header flags like ACK was fragile and not working when RTnet was running on big endian processors. Use the macro provided by the linux kernel for setting the TCP flags instead. Signed-off-by: Sebastian Smolorz --- kernel/drivers/net/stack/ipv4/tcp/tcp.c | 9 + 1 file

[PATCH v2 1/8] net/tcp: return ufd in rt_tcp_accept()

2018-11-06 Thread Sebastian Smolorz via Xenomai
Fix compilation error in rt_tcp_accept() when returning its socket's own file descriptor. Signed-off-by: Sebastian Smolorz --- kernel/drivers/net/stack/ipv4/tcp/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/drivers/net/stack/ipv4/tcp/tcp.c

[PATCH v2 3/8] net/tcp: Fix bug when obtaining RST socket's private structure from its rtdm_fd pointer

2018-11-06 Thread Sebastian Smolorz via Xenomai
Signed-off-by: Sebastian Smolorz --- kernel/drivers/net/stack/ipv4/tcp/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/drivers/net/stack/ipv4/tcp/tcp.c b/kernel/drivers/net/stack/ipv4/tcp/tcp.c index 8605a8c..2678e6a 100644 ---

[PATCH v2 0/8] net/tcp: Fix several bugs and allow rttcp to be built

2018-11-06 Thread Sebastian Smolorz via Xenomai
This patch series makes RTnet's tcp module usable again. It was not working due to several bugs which showed up in combination with reworked RTDM of Xenomai 3. Tests on real hardware (little endian) were successful. A test on big endian is still pending. Sebastian Smolorz (8): net/tcp: return

[PATCH v2 5/8] net/tcp: fix TCP connection termination

2018-11-06 Thread Sebastian Smolorz via Xenomai
Closing a connected TCP socket initiates a handshake procedure. The closing socket is supposed to receive two more packets and send one ACK at the end. RTnet's TCP stack tries to get a reference to a socket before writing data to its buffer. Taking a reference to an RTnet socket in Xenomai 3 is

Re: Towards v3.0.8

2018-11-02 Thread Sebastian Smolorz via Xenomai
Hi Jan, Jan Kiszka wrote: > Hi all, > > I think it would be good to release a new stable version, now that we > have updated x86 I-pipe patches that require changes from it. I'm > currently only aware of one open issue affecting also stable, and > that's [1]. What is [1]? -- Sebastian

Re: [PATCH 0/4] net/tcp: Fix several bugs and allow rttcp to be built

2018-11-02 Thread Sebastian Smolorz via Xenomai
Sebastian Smolorz wrote: > On 31.10.18 19:18, Jan Kiszka wrote: > > On 31.10.18 17:55, Pham, Phong wrote: > > > Hi Sebastian, > > > > > > The issue has to do with endianness. We are running PowerPC (big > > > endian). So in rt_tcp_set_flags(), flags is 32-bit wide and *tf > > > is > > > 16-bit

Re: [PATCH 0/4] net/tcp: Fix several bugs and allow rttcp to be built

2018-11-02 Thread Sebastian Smolorz via Xenomai
On 31.10.18 19:18, Jan Kiszka wrote: > On 31.10.18 17:55, Pham, Phong wrote: > > Hi Sebastian, > > > > The issue has to do with endianness. We are running PowerPC (big > > endian). So in rt_tcp_set_flags(), flags is 32-bit wide and *tf is > > 16-bit wide. I modified the line from: > > > > *tf