Re: EINVAL when using connect() for udp sockets

2017-09-04 Thread Daurnimator
On 28 April 2017 at 14:48, Eric Dumazet wrote: > On Fri, 2017-04-28 at 12:55 +1000, Daurnimator wrote: >> On 1 April 2017 at 03:52, Cong Wang wrote: >> > Please submit your patch formally and with a man page patch too. >> >> Did a patch get submitted? I had a look but couldn't see it. > > Not yet

Re: EINVAL when using connect() for udp sockets

2017-04-27 Thread Eric Dumazet
On Fri, 2017-04-28 at 12:55 +1000, Daurnimator wrote: > On 1 April 2017 at 03:52, Cong Wang wrote: > > Please submit your patch formally and with a man page patch too. > > Did a patch get submitted? I had a look but couldn't see it. Not yet. I will probably wait for next cycle (linux-4.13), I h

Re: EINVAL when using connect() for udp sockets

2017-04-27 Thread Daurnimator
On 1 April 2017 at 03:52, Cong Wang wrote: > Please submit your patch formally and with a man page patch too. Did a patch get submitted? I had a look but couldn't see it.

Re: EINVAL when using connect() for udp sockets

2017-03-31 Thread Cong Wang
On Fri, Mar 31, 2017 at 9:52 AM, Cong Wang wrote: > > Please submit your patch formally and with a man page patch too. BTW, and probably IPv6 too.

Re: EINVAL when using connect() for udp sockets

2017-03-31 Thread Cong Wang
On Thu, Mar 30, 2017 at 5:02 PM, Eric Dumazet wrote: > On Thu, 2017-03-30 at 16:36 -0700, Cong Wang wrote: >> On Tue, Mar 28, 2017 at 5:52 PM, Eric Dumazet wrote: >> > On Tue, 2017-03-28 at 16:11 -0700, Eric Dumazet wrote: >> > >> >> Yes, this looks better. >> >> >> >> Although you probably need

Re: EINVAL when using connect() for udp sockets

2017-03-30 Thread Eric Dumazet
On Thu, 2017-03-30 at 16:36 -0700, Cong Wang wrote: > On Tue, Mar 28, 2017 at 5:52 PM, Eric Dumazet wrote: > > On Tue, 2017-03-28 at 16:11 -0700, Eric Dumazet wrote: > > > >> Yes, this looks better. > >> > >> Although you probably need to change a bit later this part : > >> > >> if (!inet->inet_sa

Re: EINVAL when using connect() for udp sockets

2017-03-30 Thread Cong Wang
On Tue, Mar 28, 2017 at 5:52 PM, Eric Dumazet wrote: > On Tue, 2017-03-28 at 16:11 -0700, Eric Dumazet wrote: > >> Yes, this looks better. >> >> Although you probably need to change a bit later this part : >> >> if (!inet->inet_saddr) >> inet->inet_saddr = fl4->saddr; /* Update source addre

Re: EINVAL when using connect() for udp sockets

2017-03-28 Thread Eric Dumazet
On Tue, 2017-03-28 at 16:11 -0700, Eric Dumazet wrote: > Yes, this looks better. > > Although you probably need to change a bit later this part : > > if (!inet->inet_saddr) > inet->inet_saddr = fl4->saddr; /* Update source address */ > I came up with the following tested patch for IPv4

Re: EINVAL when using connect() for udp sockets

2017-03-28 Thread Daurnimator
On 29 March 2017 at 10:11, Eric Dumazet wrote: > Should we also fix IPv6 or is this bug only about IPv4 ? In IPv6 the second connect() returns ENETUNREACH (rather than failing yet returning 0 as it does in IPv4). This should probably incorrect behaviour and should the operation should succeed.

Re: EINVAL when using connect() for udp sockets

2017-03-28 Thread Daurnimator
On 29 March 2017 at 10:44, Daurnimator wrote: > This should probably incorrect behaviour and should the operation > should succeed. Uh, not sure why there are so many "should"s in that message. This is probably incorrect behaviour and the operation should succeed.

Re: EINVAL when using connect() for udp sockets

2017-03-28 Thread Eric Dumazet
On Mon, 2017-03-27 at 21:22 -0700, Cong Wang wrote: > On Fri, Mar 24, 2017 at 4:19 PM, Eric Dumazet wrote: > > On Fri, 2017-03-24 at 15:34 -0700, Cong Wang wrote: > >> (Cc'ing Michael Kerrisk) > >> > >> On Wed, Mar 22, 2017 at 10:18 PM, Eric Dumazet > >> wrote: > >> > On Thu, 2017-03-23 at 13:22

Re: EINVAL when using connect() for udp sockets

2017-03-27 Thread Cong Wang
On Fri, Mar 24, 2017 at 4:19 PM, Eric Dumazet wrote: > On Fri, 2017-03-24 at 15:34 -0700, Cong Wang wrote: >> (Cc'ing Michael Kerrisk) >> >> On Wed, Mar 22, 2017 at 10:18 PM, Eric Dumazet >> wrote: >> > On Thu, 2017-03-23 at 13:22 +1100, Daurnimator wrote: >> >> On 9 March 2017 at 14:10, Daurnim

Re: EINVAL when using connect() for udp sockets

2017-03-24 Thread Eric Dumazet
On Fri, 2017-03-24 at 15:34 -0700, Cong Wang wrote: > (Cc'ing Michael Kerrisk) > > On Wed, Mar 22, 2017 at 10:18 PM, Eric Dumazet wrote: > > On Thu, 2017-03-23 at 13:22 +1100, Daurnimator wrote: > >> On 9 March 2017 at 14:10, Daurnimator wrote: > >> > When debugging https://github.com/daurnimato

Re: EINVAL when using connect() for udp sockets

2017-03-24 Thread Cong Wang
(Cc'ing Michael Kerrisk) On Wed, Mar 22, 2017 at 10:18 PM, Eric Dumazet wrote: > On Thu, 2017-03-23 at 13:22 +1100, Daurnimator wrote: >> On 9 March 2017 at 14:10, Daurnimator wrote: >> > When debugging https://github.com/daurnimator/lua-http/issues/73 which >> > uses https://github.com/wahern/d

Re: EINVAL when using connect() for udp sockets

2017-03-23 Thread Eric Dumazet
On Thu, 2017-03-23 at 13:22 +1100, Daurnimator wrote: > On 9 March 2017 at 14:10, Daurnimator wrote: > > When debugging https://github.com/daurnimator/lua-http/issues/73 which > > uses https://github.com/wahern/dns we ran into an issue where modern > > linux kernels return EINVAL if you try and re

Re: EINVAL when using connect() for udp sockets

2017-03-22 Thread Daurnimator
On 9 March 2017 at 14:10, Daurnimator wrote: > When debugging https://github.com/daurnimator/lua-http/issues/73 which > uses https://github.com/wahern/dns we ran into an issue where modern > linux kernels return EINVAL if you try and re-use a udp socket. > The issue seems to occur if you go from a

EINVAL when using connect() for udp sockets

2017-03-08 Thread Daurnimator
When debugging https://github.com/daurnimator/lua-http/issues/73 which uses https://github.com/wahern/dns we ran into an issue where modern linux kernels return EINVAL if you try and re-use a udp socket. The issue seems to occur if you go from a local destination ip to a non-local one. >From conne