Re: [Openvpn-devel] [PATCH 2/3] Use dedicated multi->dco_peer_id for DCO instead of multi->peer_id

2022-10-12 Thread Antonio Quartulli
Hi, On 12/10/2022 22:43, Gert Doering wrote: Hi, On Wed, Oct 12, 2022 at 03:34:55PM +0200, Arne Schwabe wrote: The lifetime and state machine of multi->peer_id does not exactly the lifetime/state of DCO. This is especially for p2p NCP where a reconnection can change the peer id. Also use this

Re: [Openvpn-devel] [PATCH 2/3] Use dedicated multi->dco_peer_id for DCO instead of multi->peer_id

2022-10-12 Thread Gert Doering
Hi, On Wed, Oct 12, 2022 at 03:34:55PM +0200, Arne Schwabe wrote: > The lifetime and state machine of multi->peer_id does not exactly the > lifetime/state of DCO. This is especially for p2p NCP where a reconnection > can change the peer id. Also use this new field with value -1 to mean > not insta

Re: [Openvpn-devel] route/iroute handling on FreeBSD

2022-10-12 Thread Kristof Provost
Hi Gert, I’m still travelling today (and am due for my 5G chip update tomorrow), so it’ll be another day or two before I can look at this in any detail, but at first glance this looks sane. Best regards, Kristof On 12 Oct 2022, at 15:38, Gert Doering wrote: > Hi, > > people have alreadycomplai

[Openvpn-devel] [PATCH 1/2] FreeBSD: for topology subnet, put tun interface into IFF_BROADCAST mode

2022-10-12 Thread Gert Doering
For reasons unknown, OpenVPN has always put FreeBSD tun(4) interfaces into point-to-point mode (IFF_POINTOPOINT), which means "local and remote address, no on-link subnet". "--topology subnet" was emulated by adding a subnet-route to the "remote" (which was just picking a free address from the sub

[Openvpn-devel] [PATCH 2/2] FreeBSD DCO: introduce real subnet mode

2022-10-12 Thread Gert Doering
To be able to configure a FreeBSD interface to "subnet" mode (as opposed to point-to-point mode), it needs to have its if_iflags set to IFF_BROADCAST. For tun(4) interface this is done with the TUNSIFMODE ioctl(), but this does not work for more modern interfaces like ovpn(4) which communicate ove

Re: [Openvpn-devel] route/iroute handling on FreeBSD

2022-10-12 Thread Gert Doering
Hi, people have alreadycomplained at me that I write so long e-mails today, so I can write more... On Wed, Oct 12, 2022 at 08:39:31AM +0200, Gert Doering wrote: > Factor 1: single-peer (client or p2p) vs. multi-peer > > single-peer -> DCO has only 1 peer, all packets that go into the >

[Openvpn-devel] [PATCH 3/3] Call dco_p2p_add_new_peer again if the peer id changes

2022-10-12 Thread Arne Schwabe
This allows a reconnect in p2p mode and has the side effect of updating the peer address with the peerid Signed-off-by: Arne Schwabe --- src/openvpn/forward.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src/openvpn/forward.c b/src/openvpn/forward.c index 8db4f2ce1..e56028c0c 10064

[Openvpn-devel] [PATCH 1/3] Move dco_installed from sock->info to sock->info.lsa.actual

2022-10-12 Thread Arne Schwabe
For tcp this makes no difference as the remote address of the socket never changes. For udp this allows OpenVPN to differentiate if a reconnecting client is using the same address as before or from a different one. This allow sending via the normal userspace socket in that case. Signed-off-by: Arn

[Openvpn-devel] [PATCH 2/3] Use dedicated multi->dco_peer_id for DCO instead of multi->peer_id

2022-10-12 Thread Arne Schwabe
The lifetime and state machine of multi->peer_id does not exactly the lifetime/state of DCO. This is especially for p2p NCP where a reconnection can change the peer id. Also use this new field with value -1 to mean not installed, replacing the dco_peer_added field. Signed-off-by: Arne Schwabe ---

Re: [Openvpn-devel] [PATCH v5] push-peer-info: rearrange function generating peer info

2022-10-12 Thread Arne Schwabe
-} -else -{ -if (!write_empty_string(buf)) /* no peer info */ -{ +/* invalid value configured */ +default: +msg(M_WARN, "Invalid peer-info-detail level %d", session->opt->push_peer_info_detail); goto error; This should pro