It seems not to compile ovpn-cli successfully
Hi Antonio, Lev,
I'm a end user of OpenVPN. I have been paying close attention to any solution that makes OpenVPN data channel running in the kernel space. Many thanks to you bringing ovpn-dco finnaly out. Can not wait to have a try. So I tried compiling it. Kernel module is OK to compile without issues in my Ubuntu 18.04 PC, but it seems not to compile ovpn-cli successfully. I did not see OVPN_CIPHER_ALG_CHACHA20POLY1305 is defined. Did I miss to install some header files or lib?
% make tests make -C tests make[1]: Entering directory '/mnt/sdb3/project/openvpn/ovpn-dco.git/tests'
cc -Wall ovpn-cli.c -I../include/uapi \ pkg-config --cflags --libs libnl-3.0 libnl-genl-3.0 \ -lmbedtls -lmbedcrypto -o ovpn-cli In file included from /usr/include/libnl3/netlink/socket.h:16:0,
from ovpn-cli.c:17: /usr/include/libnl3/netlink/handlers.h:51:15: warning: ‘struct nlmsgerr’ declared inside parameter list will not be visible outside of this definition or declaration
struct nlmsgerr *nlerr, void *arg);
^~~~~~~~/usr/include/libnl3/netlink/handlers.h:50:43: warning: ‘struct sockaddr_nl’ declared inside parameter list will not be visible outside of this definition or declaration
typedef int (*nl_recvmsg_err_cb_t)(struct sockaddr_nl *nla,
^~~~~~~~~~~/usr/include/libnl3/netlink/handlers.h:135:18: warning: ‘struct sockaddr_nl’ declared inside parameter list will not be visible outside of this definition or declaration
struct sockaddr_nl *,
^~~~~~~~~~~ovpn-cli.c: In function ‘ovpn_nl_msg_send’:
ovpn-cli.c:232:38: warning: passing argument 3 of ‘nl_cb_err’ from incompatible pointer type [-Wincompatible-pointer-types]
nl_cb_err(ctx->nl_cb, NL_CB_CUSTOM, ovpn_nl_cb_error, &status);
^~~~~~~~~~~~~~~~
In file included from /usr/include/libnl3/netlink/socket.h:16:0,
from ovpn-cli.c:17:/usr/include/libnl3/netlink/handlers.h:127:13: note: expected ‘nl_recvmsg_err_cb_t {aka int (*)(struct sockaddr_nl *, struct nlmsgerr *, void *)}’ but argument is of type ‘int (*)(struct sockaddr_nl *, struct nlmsgerr *, void *)’
extern int nl_cb_err(struct nl_cb *, enum nl_cb_kind, nl_recvmsg_err_cb_t,
^~~~~~~~~ovpn-cli.c: In function ‘ovpn_read_cipher’:
ovpn-cli.c:355:17: error: ‘OVPN_CIPHER_ALG_CHACHA20POLY1305’ undeclared (first use in this function); did you mean ‘OVPN_CIPHER_ALG_CHACHA20_POLY1305’?
ctx->cipher = OVPN_CIPHER_ALG_CHACHA20POLY1305;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
OVPN_CIPHER_ALG_CHACHA20_POLY1305
Tony
Hi Tony,
Thanks a lot for your interest in ovpn-dco!
It's amazing to see other people putting effort in using and testing our new kernel module :-)
See my replies below:
Quoted 20 lines · 荒涯
/usr/include/libnl3/netlink/handlers.h:51:15: warning: ‘struct nlmsgerr’ declared inside parameter list will not be visible outside of this definition or declaration
struct nlmsgerr *nlerr, void *arg);
^~~~~~~~/usr/include/libnl3/netlink/handlers.h:50:43: warning: ‘struct sockaddr_nl’ declared inside parameter list will not be visible outside of this definition or declaration
typedef int (*nl_recvmsg_err_cb_t)(structsockaddr_nl*nla, ^~~~~~~~~~~/usr/include/libnl3/netlink/handlers.h:135:18: warning: ‘struct sockaddr_nl’ declared inside parameter list will not be visible outside of this definition or declaration
structsockaddr_nl*,
^~~~~~~~~~~ovpn-cli.c: In function ‘ovpn_nl_msg_send’:
ovpn-cli.c:232:38: warning: passing argument 3 of ‘nl_cb_err’ from incompatible pointer type [-Wincompatible-pointer-types]nl_cb_err(ctx->nl_cb, NL_CB_CUSTOM, ovpn_nl_cb_error, &status); ^~~~~~~~~~~~~~~~
Quoted 8 lines
In file included from
/usr/include/libnl3/netlink/socket.h:16:0, from ovpn-cli.c:17:/usr/include/libnl3/netlink/handlers.h:127:13: note: expected ‘nl_recvmsg_err_cb_t {aka int (*)(structsockaddr_nl*, struct nlmsgerr *, void *)}’ but argument is of type ‘int (*)(structsockaddr_nl*, struct nlmsgerr *, void *)’
extern int nl_cb_err(structnl_cb*, enumnl_cb_kind,nl_recvmsg_err_cb_t, ^~~~~~~~~
We haven't seen this issue so far, probably because we are using a more recent libnl version (we test with libnl3.4 and libnl3.5).
I added a potential fix in latest master.
Quoted 7 lines
ovpn-cli.c: In function ‘ovpn_read_cipher’:
ovpn-cli.c:355:17: error: ‘OVPN_CIPHER_ALG_CHACHA20POLY1305’ undeclared (first use in this function); did you mean ‘OVPN_CIPHER_ALG_CHACHA20_POLY1305’?
ctx->cipher =OVPN_CIPHER_ALG_CHACHA20POLY1305; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~OVPN_CIPHER_ALG_CHACHA20_POLY1305
Ouch, this is my fault. It is fixed in the latest master now.
Can you please give latest master another try and let us know?
Thanks!
Signature · 1 line
Antonio Quartulli
Hi Antonio,
Thanks. Confirmed this issue has been fixed. Will test performance. If more issues are encountered, will report.
Tony
------------------ 原始邮件 ------------------
发件人: "Antonio Quartulli" <[email protected]...>;
发送时间: 2020年11月18日(星期三) 下午3:36 收件人: "Tony"<[email protected]...>;"Openvpn-devel"<[email protected]>;"antonio"<[email protected]...>;"lev"<[email protected]...>;
主题: Re: [Openvpn-devel] [ovpn-dco] It seems not to compile ovpn-cli successfully
Hi Tony,
Thanks a lot for your interest in ovpn-dco!
It's amazing to see other people putting effort in using and testing our new kernel module :-)
See my replies below:
On 18/11/2020 03:31, 荒涯 wrote:
> /usr/include/libnl3/netlink/handlers.h:51:15: warning: ‘struct nlmsgerr’
> declared inside parameter list will not be visible outside of this
> definition or declaration > struct nlmsgerr *nlerr, void *arg);
> ^~~~~~~~
> /usr/include/libnl3/netlink/handlers.h:50:43: warning: ‘struct
> sockaddr_nl’ declared inside parameter list will not be visible outside
> of this definition or declaration
> typedef int (*nl_recvmsg_err_cb_t)(struct sockaddr_nl *nla,
> ^~~~~~~~~~~ > /usr/include/libnl3/netlink/handlers.h:135:18: warning: ‘struct
> sockaddr_nl’ declared inside parameter list will not be visible outside
> of this definition or declaration
> struct sockaddr_nl *,
> ^~~~~~~~~~~
> ovpn-cli.c: In function ‘ovpn_nl_msg_send’:
> ovpn-cli.c:232:38: warning: passing argument 3 of ‘nl_cb_err’ from
> incompatible pointer type [-Wincompatible-pointer-types]
> nl_cb_err(ctx->nl_cb, NL_CB_CUSTOM, ovpn_nl_cb_error, &status);
> ^~~~~~~~~~~~~~~~
> In file included from /usr/include/libnl3/netlink/socket.h:16:0,
> from ovpn-cli.c:17:
> /usr/include/libnl3/netlink/handlers.h:127:13: note: expected
> ‘nl_recvmsg_err_cb_t {aka int (*)(struct sockaddr_nl *, struct nlmsgerr
> *, void *)}’ but argument is of type ‘int (*)(struct sockaddr_nl *,
> struct nlmsgerr *, void *)’
> extern int nl_cb_err(struct nl_cb *, enum nl_cb_kind, nl_recvmsg_err_cb_t,
> ^~~~~~~~~
We haven't seen this issue so far, probably because we are using a more recent libnl version (we test with libnl3.4 and libnl3.5).
I added a potential fix in latest master.
> ovpn-cli.c: In function ‘ovpn_read_cipher’:
> ovpn-cli.c:355:17: error: ‘OVPN_CIPHER_ALG_CHACHA20POLY1305’ undeclared
> (first use in this function); did you mean
> ‘OVPN_CIPHER_ALG_CHACHA20_POLY1305’?
> ctx->cipher = OVPN_CIPHER_ALG_CHACHA20POLY1305;
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > OVPN_CIPHER_ALG_CHACHA20_POLY1305
Ouch, this is my fault. It is fixed in the latest master now.
Can you please give latest master another try and let us know?
Thanks!
Signature · 1 line
Antonio Quartulli