Skip to contentSkip to conversation

It seems not to compile ovpn-cli successfully

Openvpn-devel 荒涯 2 participants 3 messages Nov 18, 2020

lore
Share & tools
lore

荒涯

author
#0 lore raw

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

#1 lore raw

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)(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); ^~~~~~~~~~~~~~~~

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 (*)(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.

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
author
#2 lore raw

Hi Antonio,

Thanks. Confirmed this issue has been fixed. Will test performance. If more issues are encountered, will report.

Tony

------------------ 原始邮件 ------------------
发件人: "Antonio Quartulli" <[email protected]...&gt;;
发送时间:&nbsp;2020年11月18日(星期三) 下午3:36 收件人:&nbsp;"Tony"<[email protected]...&gt;;"Openvpn-devel"<[email protected]&gt;;"antonio"<[email protected]...&gt;;"lev"<[email protected]...&gt;;

主题:&nbsp;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:
&gt; /usr/include/libnl3/netlink/handlers.h:51:15: warning: ‘struct nlmsgerr’
&gt; declared inside parameter list will not be visible outside of this
&gt; definition or declaration&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &gt; &nbsp; &nbsp; &nbsp; &nbsp; struct nlmsgerr *nlerr, void *arg);
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^~~~~~~~
&gt; /usr/include/libnl3/netlink/handlers.h:50:43: warning: ‘struct
&gt; sockaddr_nl’ declared inside parameter list will not be visible outside
&gt; of this definition or declaration
&gt; &nbsp;typedef int (*nl_recvmsg_err_cb_t)(struct sockaddr_nl *nla,
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^~~~~~~~~~~ &gt; /usr/include/libnl3/netlink/handlers.h:135:18: warning: ‘struct
&gt; sockaddr_nl’ declared inside parameter list will not be visible outside
&gt; of this definition or declaration
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;struct sockaddr_nl *,
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^~~~~~~~~~~
&gt; ovpn-cli.c: In function ‘ovpn_nl_msg_send’:
&gt; ovpn-cli.c:232:38: warning: passing argument 3 of ‘nl_cb_err’ from
&gt; incompatible pointer type [-Wincompatible-pointer-types]
&gt; &nbsp; nl_cb_err(ctx-&gt;nl_cb, NL_CB_CUSTOM, ovpn_nl_cb_error, &amp;status);
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^~~~~~~~~~~~~~~~
&gt; In file included from /usr/include/libnl3/netlink/socket.h:16:0,
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;from ovpn-cli.c:17:
&gt; /usr/include/libnl3/netlink/handlers.h:127:13: note: expected
&gt; ‘nl_recvmsg_err_cb_t {aka int (*)(struct sockaddr_nl *, struct nlmsgerr
&gt; *, void *)}’ but argument is of type ‘int (*)(struct sockaddr_nl *,
&gt; struct nlmsgerr *, void *)’
&gt; &nbsp;extern int&nbsp; nl_cb_err(struct nl_cb *, enum nl_cb_kind, nl_recvmsg_err_cb_t,
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^~~~~~~~~

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.

&gt; ovpn-cli.c: In function ‘ovpn_read_cipher’:
&gt; ovpn-cli.c:355:17: error: ‘OVPN_CIPHER_ALG_CHACHA20POLY1305’ undeclared
&gt; (first use in this function); did you mean
&gt; ‘OVPN_CIPHER_ALG_CHACHA20_POLY1305’?
&gt; &nbsp; &nbsp;ctx-&gt;cipher = OVPN_CIPHER_ALG_CHACHA20POLY1305;
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;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