Re: [Openvpn-devel] [PATCH 1/1] replace deprecated LZ4 function

2016-12-15 Thread David Sommerseth
On 15/12/16 15:06, Christian Hesse wrote:
> From: Christian Hesse 
> 
> The LZ4 function LZ4_compress_limitedOutput() is deprecated, compiler
> gives warning:
> 
> warning: ‘LZ4_compress_limitedOutput’ is deprecated: use
> LZ4_compress_default() instead
> 
> The new function LZ4_compress_default() appeared in r129 (1.7.0), so
> replace the function there.
> 
> Signed-off-by: Christian Hesse 
> ---
>  src/openvpn/comp-lz4.c | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/openvpn/comp-lz4.c b/src/openvpn/comp-lz4.c
> index 6b7c49b..a6ce4f7 100644
> --- a/src/openvpn/comp-lz4.c
> +++ b/src/openvpn/comp-lz4.c
> @@ -87,7 +87,11 @@ do_lz4_compress(struct buffer *buf,
>  return false;
>  }
>  
> +#if defined LZ4_VERSION_NUMBER && LZ4_VERSION_NUMBER >= 10700
> +zlen = LZ4_compress_default((const char *)BPTR(buf), (char 
> *)BPTR(work), BLEN(buf), zlen_max );
> +#else
>  zlen = LZ4_compress_limitedOutput((const char *)BPTR(buf), (char 
> *)BPTR(work), BLEN(buf), zlen_max );
> +#endif
>  
>  if (zlen <= 0)
>  {
> 

This makes sense.  But I think we should do this in relation to an
update of the compat-lz4 library we also ship in OpenVPN.  I'm running
some tests now, and will submit a new mail thread which includes this
patch together with the compat-lz4.[ch] update.

This will be handled post v2.4.0 release, so we don't rush the testing
of the LZ4 support and inadvertently break anything.


-- 
kind regards,

David Sommerseth
OpenVPN Technologies, Inc




signature.asc
Description: OpenPGP digital signature
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


Re: [Openvpn-devel] [PATCH 1/1] replace deprecated LZ4 function

2016-12-15 Thread David Woodhouse
On Thu, 2016-12-15 at 14:26 +0100, Christian Hesse wrote:
> -    zlen = LZ4_compress_limitedOutput((const char *)BPTR(buf), (char 
> *)BPTR(work), BLEN(buf), zlen_max );
> +    zlen = LZ4_compress_default((const char *)BPTR(buf), (char 
> *)BPTR(work), BLEN(buf), zlen_max );

You might want to do that conditionally. Some platforms might still be
using versions of liblz4 older than r129, where LZ4_compress_default()
was introduced.

http://git.infradead.org/users/dwmw2/openconnect.git/commitdiff/01d40d8

-- 
dwmw2

smime.p7s
Description: S/MIME cryptographic signature
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel