Use different device name with FreeBSD

Muenz, Michael m.muenz at spam-fetish.org
Fri Mar 9 05:55:51 PST 2018


Am 08.03.2018 um 20:47 schrieb Nikos Mavrogiannopoulos:
> On Thu, Mar 1, 2018 at 9:35 AM, Muenz, Michael <m.muenz at spam-fetish.org> wrote:
>> Hi list
>>
>> I'm want to build a OCServ plugin for OPNsense Firewall based on FreeBSD.
>> In the config there's an option "device" to set the name of the tun device.
>>
>> It seems to work fine on Linux but it doesn't work for FreeBSD.
>> Whenever I connect with a client the device is called tunX+1.
>>
>> Sadly this does interfere with the logic of OPNsense to assign interfaces
>> via UI.
>>
>> Do you see any chances to port this feature also to FreeBSD?
> Would you like to try this branch of ocserv?
> https://gitlab.com/ocserv/ocserv/merge_requests/71
>
> regards,
> Nikos
>
Hi Nikos,

thanks for the patch but it doesn't compile against my ports:


In file included from worker-resume.c:36:
./vpn.h:90:12: warning: comparison of unsigned enum expression < 0 is 
always false [-Wtautological-compare]
         if (proto < 0 || proto >= PROTO_MAX)
             ~~~~~ ^ ~
depbase=`echo worker-http.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
cc -DHAVE_CONFIG_H -I. -I..   -I../src/http-parser/  -I./../gl/ 
-I./../gl/ -I./ -I./../ -I./../ -I../libopts -I/usr/local/include 
-I/usr/local/include/p11-kit-1  -I./common -I./common 
-I/usr/local/include  -I/usr/local/include    -I/usr/local/include 
-I/usr/local/include/liboath    -I/usr/local/include 
-I/usr/local/include/p11-kit-1  -I./pcl/ -I/usr/local/include -isystem 
/usr/local/include  -O2 -pipe  -fPIE -fPIC -fstack-protector-all 
-isystem /usr/local/include -fno-strict-aliasing -Wall 
-Wno-strict-aliasing -MT worker-http.o -MD -MP -MF $depbase.Tpo -c -o 
worker-http.o worker-http.c &&\
mv -f $depbase.Tpo $depbase.Po
tun.c:460:11: warning: implicit declaration of function 'GETCONFIG' is 
invalid in C99 [-Wimplicit-function-declaration]
In file included from GETCONFIG(s)->network.name, i);
                                ^
config.ctun.c:460:25: error: member reference type 'int' is not a pointer
:                               GETCONFIG(s)->network.name, i);
                                ~~~~~~~~~~~~  ^
36:
In file included from ./auth/pam.h:25:
In file included from ./sec-mod-auth.h:24:
In file included from ./main.h:29:
./vpn.h:90:12: warning: comparison of unsigned enum expression < 0 is 
always false [-Wtautological-compare]
         if (proto < 0 || proto >= PROTO_MAX)
             ~~~~~ ^ ~
tun.c:583:15: warning: unused variable 'ifr' [-Wunused-variable]
         struct ifreq ifr;
                      ^
tun.c:584:15: warning: unused variable 't' [-Wunused-variable]
         unsigned int t;
                      ^
In file included from sec-mod-resume.c:36:
./vpn.h:90:12: warning: comparison of unsigned enum expression < 0 is 
always false [-Wtautological-compare]
         if (proto < 0 || proto >= PROTO_MAX)
             ~~~~~ ^ ~
4 warnings and 1 error generated.
gmake[5]: *** [Makefile:1690: tun.o] Error 1
gmake[5]: *** Waiting for unfinished jobs....
In file included from worker-http-handlers.c:37:
./vpn.h:90:12: warning: comparison of unsigned enum expression < 0 is 
always false [-Wtautological-compare]
         if (proto < 0 || proto >= PROTO_MAX)
             ~~~~~ ^ ~
1 warning generated.
config.c:908:11: warning: comparison of unsigned expression < 0 is 
always false [-Wtautological-compare]
                 if (ret < 0) {
                     ~~~ ^ ~
In file included from worker-http.c:38:
./vpn.h:90:12: warning: comparison of unsigned enum expression < 0 is 
always false [-Wtautological-compare]
         if (proto < 0 || proto >= PROTO_MAX)
             ~~~~~ ^ ~
1 warning generated.
worker-http.c:321:23: warning: comparison of constant -1 with expression 
of type 'gnutls_cipher_algorithm_t' (aka 'enum gnutls_cipher_algorithm') 
is always true [-Wtautological-constant-out-of-range-compare]
                                             (want_cipher != -1 && 
want_cipher == ciphersuites[i].gnutls_cipher &&
                                              ~~~~~~~~~~~ ^  ~~
worker-http.c:328:23: warning: comparison of constant -1 with expression 
of type 'gnutls_cipher_algorithm_t' (aka 'enum gnutls_cipher_algorithm') 
is always true [-Wtautological-constant-out-of-range-compare]
                                                 if (want_cipher != -1) {
                                                     ~~~~~~~~~~~ ^ ~~
In file included from worker-http.c:547:
http-heads.gperf:37:36: warning: static variable 'wordlist' is used in 
an inline function with external linkage [-Wstatic-in-inline]
           register const char *s = wordlist[key].name;
                                    ^
http-heads.gperf:23:1: note: use 'static' to give inline function 
'in_word_set' internal linkage
__inline
^
static
http-heads.gperf:72:37: note: 'wordlist' declared here
static const struct http_headers_st wordlist[] =
                                     ^
http-heads.gperf:40:21: warning: static variable 'wordlist' is used in 
an inline function with external linkage [-Wstatic-in-inline]
             return &wordlist[key];
                     ^
http-heads.gperf:23:1: note: use 'static' to give inline function 
'in_word_set' internal linkage
__inline
^
static
http-heads.gperf:72:37: note: 'wordlist' declared here
static const struct http_headers_st wordlist[] =
                                     ^
1 warning generated.
5 warnings generated.
1 warning generated.
2 warnings generated.
gmake[5]: Leaving directory '/usr/ports/net/ocserv/work/ocserv-0.11.10/src'
gmake[4]: *** [Makefile:1231: all] Error 2
gmake[4]: Leaving directory '/usr/ports/net/ocserv/work/ocserv-0.11.10/src'
gmake[3]: *** [Makefile:1046: all-recursive] Error 1
gmake[3]: Leaving directory '/usr/ports/net/ocserv/work/ocserv-0.11.10'
gmake[2]: *** [Makefile:979: all] Error 2
gmake[2]: Leaving directory '/usr/ports/net/ocserv/work/ocserv-0.11.10'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/net/ocserv
*** Error code 1

Stop.
make: stopped in /usr/ports/net/ocserv



Thanks,
Michael



More information about the openconnect-devel mailing list