Skip to content

Various patches to improve DCO behaviour

Arne Schwabe openvpn-devel 1 version In review

Get series with b4
b4 am [email protected]...

Versions newest first

  1. v1 Latest9 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9Rename TM_UNTRUSTED to TM_INITIALsrc/openvpn/ssl.c src/openvpn/ssl.h src/openvpn/ssl_common.h+10 -101 reply
2/9Always start session in TM_INITIAL rather than TM_ACTIVE or TM_INITIALsrc/openvpn/mudp.c src/openvpn/ssl.c+36 -651 reply
3/9Move dco_installed back to link_socket from link_socket.info.actualsrc/openvpn/dco.c src/openvpn/forward.c src/openvpn/init.c +3 more+22 -411 reply
4/9Ensure we do not promote a TA_TIMEOUT to a TA_WRITE/TA_READ event with dcosrc/openvpn/forward.c src/openvpn/forward.h src/openvpn/mtcp.c+42 -261 reply
5/9Also drop incoming dco packet content when dropping the packetsrc/openvpn/forward.c src/openvpn/multi.c+4 -01 reply
6/9Do not set nl socket buffer sizesrc/openvpn/dco_linux.c+0 -31 reply
7/9Bail out when trying to install a TCP socket with residual data to DCOsrc/openvpn/mtcp.c src/openvpn/multi.c+10 -21 reply
8/9Improve logging when seeing a message for an unkown peersrc/openvpn/multi.c+11 -11 reply
9/9Ignore OVPN_DEL_PEER_REASON_USERSPACE to avoid race conditionssrc/openvpn/multi.c+17 -43 replies

Reviews trailers per patch

6 of 9 patches have a Reviewed-by or Acked-by.

PatchGert Doering
1/9A-b
2/9A-b
3/9A-b
4/9
5/9A-b
6/9A-b
7/9
8/9A-b
9/9

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Openvpn-devel] [PATCH 0/9] Various patches to improve DCO behaviour

This is a list of various patches that improve certain corner cases of DCO behaviour or improve. The remaining issues seem to be in the ovpn-dco module and need to fixed there first. Remaining issues in ovpn-dco:

- if there are a lot of event, the recvfrom the netlink socket will give a ENOMEM. Using Control-S and Control-Q to temporarily pause the OpenVPN daemon is a reliable way for me to trigger it.

- OpenVPN tcp sessions that are gone, especially when doing TCP reset are not notified to the user space

- With UDP and bombarding server already when starting up gives me a hard freeze

- Unload ovpn-dco sometimes does not work. Getting 'In use by xy ' failures.

- Latest FreeBSD dco module seems to be very broken. Reverting latest commit fixes it.

Arne Schwabe (9):
Rename TM_UNTRUSTED to TM_INITIAL
Always start session in TM_INITIAL rather than TM_ACTIVE or TM_INITIAL

These two could be smashed into one commit but two makes reviewing easier. They clean up the state machine a bit and by doing so fix an obscore corner case that would not work in p2p dco.

Move dco_installed back to link_socket from link_socket.info.actual

With the intention of moving back to using normal send/recv instead of using netlink, the special handling of figuring out which peer address uses wht mechansim is no longer necessary. Instead of hunting the bug down, just always use sendto when wanting to send something.

Ensure we do not promote a TA_TIMEOUT to a TA_WRITE/TA_READ event with
dco
Ensures that we do not go to a socket write/read on a DCO installed TCP socket.

Also drop incoming dco packet content when dropping the packet otherwise we would not clear the received packet and the dco code would refuse to put a new one there.

Do not set nl socket buffer size
This does not change anything and is more cosmetic.

Bail out when trying to install a TCP socket with residual data to DCO

This is something we could probably fix if we spent a lot more time and only ever read as little as possible (i.e. read 2 bytes to know next packet length, and then read only the length of the next packet). But instead of adding a lot of extra code, I rather want to wait for the plans of ovpn-dco and tcp and how the API evolves.

Improve logging when seeing a message for an unkown peer Ignore OVPN_DEL_PEER_REASON_USERSPACE to avoid race conditions

This commit fixes a race condition that lead to OpenVPN trying to add a peer that already existed.

 src/openvpn/dco.c        |  23 +-------
 src/openvpn/dco_linux.c  |   3 --
 src/openvpn/forward.c    |  27 ++--------
 src/openvpn/forward.h    |  30 +++++++++++
 src/openvpn/init.c       |   2 +-
 src/openvpn/mtcp.c       |  20 +++++--
 src/openvpn/mudp.c       |   2 +-
 src/openvpn/multi.c      |  45 +++++++++++++---
 src/openvpn/socket.c     |   8 +--
 src/openvpn/socket.h     |  11 ++--
 src/openvpn/ssl.c        | 113 +++++++++++++++------------------------
 src/openvpn/ssl.h        |   2 +-
 src/openvpn/ssl_common.h |   2 +-
 13 files changed, 144 insertions(+), 144 deletions(-)
Signature · 1 line
2.37.1 (Apple Git-137.1)