1. 25 Jul, 2022 1 commit
  2. 22 May, 2022 1 commit
  3. 29 Mar, 2022 1 commit
  4. 13 Feb, 2022 2 commits
  5. 02 Feb, 2022 1 commit
  6. 26 Jan, 2022 1 commit
  7. 21 Jan, 2022 1 commit
  8. 14 Dec, 2021 1 commit
  9. 15 Jun, 2021 1 commit
  10. 14 May, 2021 1 commit
  11. 03 May, 2021 2 commits
  12. 22 Apr, 2021 1 commit
  13. 07 Apr, 2021 1 commit
  14. 02 Apr, 2021 1 commit
  15. 01 Apr, 2021 1 commit
  16. 25 Mar, 2021 1 commit
  17. 19 Mar, 2021 1 commit
    • Arne Schwabe's avatar
      Fix multiple problems when compiling with LLVM/Windows (clang-cl) · 45e7d412
      Arne Schwabe authored
      
      
      When using the LLVM clang compiler instead the MSVC cl.exe but with
      the same build environment as MSVC, clang encounters a few errors:
      
      src\openvpn\socket.c(3550,23): warning: assigning to 'CHAR *' (aka 'char
      *') from 'uint8_t *' (aka 'unsigned char *') converts between pointers to
      integer types with different sign [-Wpointer-sign]
              wsabuf[0].buf = BPTR(&sock->reads.buf);
                            ^ ~~~~~~~~~~~~~~~~~~~~~~
      src\openvpn\socket.c(3670,23): warning: assigning to 'CHAR *' (aka 'char
      *') from 'uint8_t *' (aka 'unsigned char *') converts between pointers to
      integer types with different sign [-Wpointer-sign]
              wsabuf[0].buf = BPTR(&sock->writes.buf);
                            ^ ~~~~~~~~~~~~~~~~~~~~~~~
      
      Use BSTR instead of BPTR, which casts to the correct type that is
      expected.
      
      src\compat\compat-gettimeofday.c(105,18): error: assignment to cast is
      illegal, lvalue casts are not supported
          tv->tv_sec = (long)last_sec = (long)sec;
      
      Split into two assignments to avoid the illegal cast
      
      include\stdint.h(18,28): error: typedef redefinition with different types
      ('signed char' vs 'char')
      typedef signed char        int8_t;
                                 ^
      openvpn\config-msvc.h(162,16): note: previous definition is here
      typedef __int8 int8_t;
      
      Removes our custom int type typdefs from config-msvc.h and replace it
      with an include of inttypes.h.
      
      C:\Program Files (x86)\Windows
      Kits\10\include\10.0.19041.0\shared\tcpmib.h(56,3): error: typedef
      redefinition with different types ('enum MIB_TCP_STATE' vs 'int')
      } MIB_TCP_STATE;
        ^
      C:\Users\User\source\repos\openvpn\src\openvpn/syshead.h(369,13): note:
      previous definition is here
      typedef int MIB_TCP_STATE;
                  ^
      1 error generated.
      
      This seems to be for mingw32 only, so guard this with a mingw32
      compiler guard.
      
      \src\openvpn\tun.c(3727,34): warning: passing 'char [256]' to parameter of
      type 'LPBYTE' (aka 'unsigned char *') converts between pointers to integer
      types with different sign [-Wpointer-sign]
                                       net_cfg_instance_id,
                                       ^~~~~~~~~~~~~~~~~~~
      C:\Program Files (x86)\Windows
      Kits\10\include\10.0.19041.0\um\winreg.h(955,88): note: passing argument
      to parameter 'lpData' here
      
      This is windows specific code, use the Windows LPBTYE in the
      definitions. (long pointer to BYTE (long pointer as far/near pointer
      relict from windows 16 bit times, in moddern words (unsigned char *))
      
      Fix also a few other char vs uint8/unisgned char/BYTE issues in tun.c
      Signed-off-by: Arne Schwabe's avatarArne Schwabe <arne@rfc2549.org>
      Acked-by: default avatarGert Doering <gert@greenie.muc.de>
      Message-Id: <20210319114631.20459-1-arne@rfc2549.org>
      URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21719.html
      
      Signed-off-by: default avatarGert Doering <gert@greenie.muc.de>
      45e7d412
  18. 30 Jan, 2021 1 commit
  19. 04 Oct, 2020 1 commit
    • Vladislav Grishenko's avatar
      Speedup TCP remote hosts connections · b68aa006
      Vladislav Grishenko authored
      
      
      For non-blocking TCP/Unix connection, OpenVPN checks was it established in
      loop and if not - sleeps or handles management for next one second. Since
      the first check is made right after the connection attempt, it will likely
      be always unsuccessful, causing redundant wait for one or more seconds:
      
          00:00:00.667607 fcntl(5, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
          00:00:00.667713 connect(5, {...}, 16) = -1 EINPROGRESS (Operation now
      in progress)
          00:00:00.667832 poll([{fd=5, events=POLLOUT}], 1, 0) = 0 (Timeout)
          00:00:00.667954 nanosleep({tv_sec=1, tv_nsec=0}, 0x7fff52450270) = 0
          00:00:01.668608 poll([{fd=5, events=POLLOUT}], 1, 0) = 1 ([{fd=5,
      revents=POLLOUT}])
      
      After this patch openvpn_connect() will perform blocking wait for
      connection
      establishment (if possible) and just check for management events once in
      one
      second (if management enabled) w/o sleep. This speedups TCP/Unix connection
      establishment and provides almost real connection time that can be used for
      detection of the fastest remote server in subsequent patches:
      
          00:00:00.790510 fcntl(5, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
          00:00:00.790616 connect(5, {...}, 16) = -1 EINPROGRESS (Operation now
      in progress)
          00:00:00.790877 poll([{fd=5, events=POLLOUT}], 1, 1000) = 0 (Timeout)
          00:00:01.792880 poll([{fd=5, events=POLLOUT}], 1, 1000) = 1 ([{fd=5,
      revents=POLLOUT}])
      
      Or, with management interface enabled:
      
          00:00:00.906421 fcntl(5, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
          00:00:00.906527 connect(6, {...}, 16) = -1 EINPROGRESS (Operation now
      in progress)
          00:00:00.906779 poll([{fd=6, events=POLLOUT}], 1, 1000) = 0 (Timeout)
          00:00:01.910418 poll([{fd=3, events=POLLIN|POLLPRI}], 1, 0) = 0
      (Timeout)
          00:00:01.911365 poll([{fd=6, events=POLLOUT}], 1, 1000) = 0 ([{fd=6,
      revents=POLLOUT}])
      
      v2: cosmetics, decrease connection_timeout to avoid wait more than it
      v3: teach management_sleep() to handle zero timeout and reject negative
          use 1s timeout for connection and 0s timeout for management events
      Signed-off-by: default avatarVladislav Grishenko <themiron@yandex-team.ru>
      Acked-by: Arne Schwabe's avatarArne Schwabe <arne@rfc2549.org>
      Message-Id: <20201001225319.25125-1-themiron@yandex-team.ru>
      URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21139.html
      
      Signed-off-by: default avatarGert Doering <gert@greenie.muc.de>
      b68aa006
  20. 02 Oct, 2020 1 commit
  21. 09 Sep, 2020 1 commit
  22. 10 Aug, 2020 1 commit
  23. 29 Jun, 2020 1 commit
  24. 20 Feb, 2020 1 commit
  25. 16 Aug, 2019 1 commit
  26. 06 Feb, 2019 1 commit
  27. 12 Dec, 2018 1 commit
  28. 16 Oct, 2018 1 commit
  29. 13 Jul, 2018 1 commit
  30. 12 Jul, 2018 1 commit
  31. 22 Feb, 2018 1 commit
    • Selva Nair's avatar
      Fix format spec errors in Windows builds · 06ad53e0
      Selva Nair authored
      - "%ll" is not supported by Windows run time, so use PRIi64
         and cast the variable to (int64_t) in output statements
         (as in commit 9ba36639
      
      )
      
      - Fix an instance of wchar_t * printed using %s -- should be %ls.
      
      - Cast variables to int or unsigned int to match the output
        format spec when necessary.
      
      - In route.c correct format of adapter_index (should be %lu) in a few
        places and remove some unnecessary casts to (unsigned int). Not
        all such instances are changed, only those related to adapter_index
        (for consistency) or close-by contexts are edited.
      
      Most of these errors are seen in current Windows cross-compile,
      but a few are triggered only if some DEBUG options are enabled.
      Some are not in Windows specific paths. But for consistency, all uses
      of %llu/%lld are removed. As these only affect log output, there are
      no potential side effects.
      
      Replacing long long by int64_t also has the advantage of avoiding
      size ambiguity as long long is not guaranteed to be 64 bytes.
      Signed-off-by: Selva Nair's avatarSelva Nair <selva.nair@gmail.com>
      Acked-by: default avatarSteffan Karger <steffan.karger@fox-it.com>
      Message-Id: <1519275295-29121-1-git-send-email-selva.nair@gmail.com>
      URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg16522.html
      
      Signed-off-by: default avatarGert Doering <gert@greenie.muc.de>
      06ad53e0
  32. 01 Feb, 2018 1 commit
  33. 21 Sep, 2017 1 commit
    • Antonio's avatar
      tcp-server: ensure AF family is propagated to child context · 682e7fea
      Antonio authored and David Sommerseth's avatar David Sommerseth committed
      Commit 23d61c56 introduced the AF_UNSPEC socket family
      to be used when we don't know the actual one until the local
      socket binding is performed.
      
      In such case AF_UNSPEC is stored in the `ce.af` member of
      the `c->options` object, indicating that the family has to be
      determined at runtime.
      
      However, the determined value is never propagated back to the
      `options` object, which remains AF_UNSPEC and that is
      later used to initialize the TCP children contexts (UDP
      children contexts are unaffected).
      
      This unexpected setting can trigger weird behaviours, like
      the one reported in ticket #933.
      In this case the value AF_UNSPEC in combination with the
      changes implemented in 2bed089d
      
       are leading to a TCP
      server quitting with M_FATAL upon client connection.
      
      Note that the misbehaviour described in #933 can only be
      triggered when running a TCP server with mtu-disc set
      in the config (no matter the value).
      
      Fix this inconsistency by always propagating the AF
      family from the top to the child context when running
      in TCP server mode.
      
      As a direct consequence, this patch fixes Trac #933.
      
      Trac: 933
      Signed-off-by: Antonio's avatarAntonio Quartulli <antonio@openvpn.net>
      Acked-by: Arne Schwabe's avatarArne Schwabe <arne@rfc2549.org>
      Message-Id: <20170907095530.15972-1-a@unstable.cc>
      URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15380.html
      
      Signed-off-by: David Sommerseth's avatarDavid Sommerseth <davids@openvpn.net>
      682e7fea
  34. 14 Aug, 2017 1 commit
  35. 20 Jul, 2017 2 commits
  36. 17 Jul, 2017 1 commit
  37. 16 Jun, 2017 1 commit