[WLUG] GCC compiling help - No TUN device

Rick Green rtg at aapsc.com
Fri Jul 20 11:39:52 EDT 2018


Does Debian have a package for JNOS?  It's probably old source that you want to 
mess with, but if there is a jnos package, then there will be a jnos-dev meta-package 
which will pull in all the dependencies necessary for compilation.

   I used to know a version of the apt or dpkg command that would search the 
repository for packages 'which provide' a given filename, but I can't pull it 
out of the memory banks at the moment.  'apt search foo' only searches the 
packages already installed, not the repository of available packages.

On my ubuntu system, tun.c appears to have come from the JNOS tarball itself, 
and tun.h and if_tun.h are part of the current kernel headers package, which I 
believe is pulled in by build-essential.  Have you
    apt-get install build-essential

   The tunnel interface is part of the standard kernel, but it is implemented as 
a module, which is not loaded by default at boot, so before you can configure a 
tun interface you have to `modprobe tun`.
Google found me this:
     https://www.techonia.com/1400/create-tunnel-interface-linux

...but you don't need to do that to compile, just before you want to run jnos.

Rick Green




On Fri, 20 Jul 2018, Jay Nugent wrote:

> Greetings fellow LUG folk,
>   It has been 10 years since I have mucked around compiling C code, and as 
> is usually the case, roadblocks and hurdles pop up that stretch my limits.
>
>   I am trying to compile the latest version of JNOS (Packet Radio software) 
> on a 64-bit machine running Debian Stretch 4.13.0-45-generic.
>
>   I have tried to find what package contains the TUN device, and simply APT 
> INSTALL it, but it has been no joy.  I am leary to just make a node (mknod) 
> and I'm not entiry sure that is what is needed.  Searching Google has just 
> added 100 more doubts into which is the correct way to go?
>
>   Once JNOS is compiled, I will need to set up a Point-to-Point Tunnel 
> between the Linux kernel and the JNOS application.  This is typically done 
> with the commands:
>
> (within JNOS)
>   attach tun tun0 1500 0
>   ifconfig tun0 ipaddress 192.168.2.1
>   ifconfig tun0 mtu 1500
>
> (then within Linux)
>   ifconfig tun0 192.168.2.2 pointtopoint 192.168.2.1 mtu 1500 up
>
>
>   But there is no TUN device on Linux so the ifconfig fails.  And I belive 
> since the TUN device doesn't exist on the Linux box, that is why the compile 
> of JNOS is failing.  At least the ERROR messages during the compile seem to 
> indicate so...
>
>   The compile goes along well until it needs to work with the TUN interface 
> (tun.c).  Then it spews some errors, and exits without creating the 
> executable:
>
> ....
> ....
> gcc -DUNIX -g3   -DDEBUG -Wall   -c -o devparam.o devparam.c
> gcc -DUNIX -g3   -DDEBUG -Wall   -c -o md5.o md5.c
> gcc -DUNIX -g3   -DDEBUG -Wall   -c -o tun.o tun.c
> In file included from netuser.h:38:0,
>                 from tcp.h:26,
>                 from iface.h:25,
>                 from tun.c:26:
> socket.h:85:21: error: expected identifier before numeric constant
> #define SOCK_STREAM 0
>                     ^
> In file included from /usr/include/x86_64-linux-gnu/sys/socket.h:33:0,
>                 from /usr/include/linux/if.h:27,
>                 from tun.c:41:
> /usr/include/x86_64-linux-gnu/bits/socket.h:174:8: error: redefinition of 
> ‘struct sockaddr’
> struct sockaddr
>        ^~~~~~~~
> In file included from socket.h:22:0,
>                 from netuser.h:38,
>                 from tcp.h:26,
>                 from iface.h:25,
>                 from tun.c:26:
> sockaddr.h:13:8: note: originally defined here
> struct sockaddr {
>        ^~~~~~~~
> <builtin>: recipe for target 'tun.o' failed
> make: *** [tun.o] Error 1
> root at SkyLake2:~/jnos-source#
>
>
>   Any compile savy folk have any suggestions?  I think if I can determine 
> how to install the package that contains the /dev/tun it *may* get me over 
> this hurdle.
>
>
>   Thanks!
>      --- Jay
>

-- 
Rick Green

We, the People of the United States of America, reject the U.S. Supreme Court's
  Citizens United ruling, and move to amend our Constitution to firmly establish
  that money is not speech, and that human beings, not corporations, are persons
                        entitled to constitutional rights.

 			http://www.MoveToAmend.org



More information about the washlug mailing list