[OpenVPN home] [Date Prev] [Date Index] [Date Next]
[OpenVPN mailing lists] [Thread Prev] [Thread Index] [Thread Next]
Google
 
Web openvpn.net

[Openvpn-users] Solution [Again] tun/tap on Solaris 10 using Sun Studio or GNU C in 32 and 64 bit environments.


  • Subject: [Openvpn-users] Solution [Again] tun/tap on Solaris 10 using Sun Studio or GNU C in 32 and 64 bit environments.
  • From: "Rodger Lucas" <rlucas@xxxxxxxxxxxxxxxx>
  • Date: Thu, 29 Mar 2007 11:29:10 -0400

HI All:
 
I was experiencing this problem that others have reported in other flavours of Solaris through the years. It all comes down to how the driver is compiled on Solaris.
 
# /usr/sbin/add_drv -v tun
exit status = 0
devfsadm: driver failed to attach: tun
exit status = 1
Warning: Driver (tun) successfully added to system but failed to attach
Driver (tun) installed.
 
Kudos to Avnish Pundir who posted (2006-09-19) his solution to a specific problem that he was having.
 
The details for doing this correctly using Sun Studio and GNU C 32 or 64 bit environments are nicely summarized on the Sun web site at:
 
http://docs.sun.com/app/docs/doc/819-3159/6n5d9rbv8?a=view#fgouv
 
But to summarize the compiling and copying to the correct location ....
 
# Sun Studio targetting 64 bit SPARC
% cc -D_KERNEL -xarch=v9 -c tun.c
# Sun Studio targetting 64 bit x86
%cc -D_KERNEL -xarch=amd64 -xmodel=kernel -c tun.c
# Sun Studio targetting 32 bit
% cc -D_KERNEL -c tun.c
# GNU C Compiler targetting 64 bit SPACE ( optional: mtune=ultrasparc -O2 )
% gcc -D_KERNEL -m64 -mcpu=v9 -mcmodel=medlow -fno-pic -mno-fpu -ffreestanding -nodefaultlibs -c tun.c
 
# GNU C Compiler targetting 64 bit x86 ( optional: mtune=opteron -O2 )
% gcc -D_KERNEL -m64 -mcmodel=kernel -mno-red-zone -ffreestanding -nodefaultlibs -c tun.c
 
# GNU C Compiler targetting 32 bit
% gcc -D_KERNEL -ffreestanding -nodefaultlibs -c tun.c
The linking is the same for all
% usr/ccs/bin/ld -r -o tun tun.o
 
The destination is different for depending on the architecture:
 
# 64 bit sparc
cp tun /usr/kernel/drv/sparcv9/tun
# 64 bit x86
cp tun /usr/kernel/drv/amd64/tun
# 32 bit
cp tun /usr/kernel/drv/tun
 
Regards,
 

Rodger Lucas

TAZZ Networks

Glasgow

Scotland, United Kingdom

( Voice: +44 (0)141 222 2126
+ Email: rlucas@xxxxxxxxxxxxxxxx

 
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Openvpn-users mailing list
Openvpn-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/openvpn-users