Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 262765

Summary: net-misc/nstx: init scripts, qa fixes, enhancements
Product: Gentoo Linux Reporter: Steve Brudenell <steven.brudenell>
Component: New packagesAssignee: Robin Johnson <robbat2>
Status: RESOLVED FIXED    
Severity: enhancement CC: bircoph, svrmarty
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 156491, 260925    
Attachments: updated ebuild -- adds patches I supplied, as well as checks for CONFIG_TUN
patch to correct nstx's usage of Linux tuntap
patch to allow binding to interface names, as well as ip addresses
patch to print a warning when we couldn't write() enough bytes to the tunnel
delete the unused dwrite() function to eliminate a warning
patch to delete -Werror from the Makefile
init.d script for nstxd
conf.d file for nstxd
init.d script for nstxcd
conf.d file for nstxcd
corrected error in nstxd init script, whoops

Description Steve Brudenell 2009-03-17 04:31:44 UTC
I've created some patches, init scripts, and an updated ebuild for nstx.

I added the following functionality to the binaries:
 - can now bind to interface name as well as IP address
 - can specify which tun/tap device to be used (no longer defaults to tun0)
 - can correctly create tap devices instead of tun
 - now checks return value of write() calls (required to build with gcc 4.3)

I also removed -Werror from the Makefile (see bug 260925) so it should break less in the future as gcc evolves.

I also created init.d scripts and sample, well-documented conf.d files. Even though the nstx package contains both client and daemon that probably won't be used on the same machine I decided to create one init.d script for each, as it's probably less confusing to users. However, I did use Phillip Brendt's (bug 156491) init script as a base. My scripts allow for easy configuration of the options offered by nstxd/nstxcd, including the new options I added to the code itself. My scripts do not supply any IP/routing/bridging configuration to the interfaces nstx creates; I leave this to the net.* scripts instead. My scripts do provide for correct dependency configuration, so that nstx would start after the net.* script of the interface it binds to, and before the net.* script that configures the tunXX interface it creates.

Additionally I improved the ebuild slightly by checking for CONFIG_TUN using the linux-info eclass. CONFIG_TUN is required by nstx.

Note: I have submitted the actual code patches "upstream". As the website is currently 404 and there is no date past 2000 in code comments or documentation (christ i was in high school back then), this means I emailed the two guys who appear to be the original authors. I do not imagine that they'll incorporate patches into a decade-old project they don't maintain ... so I think it is fairly important that these patches live in Portage for the time being.

Happy DNS tunnelling.

Reproducible: Always

Steps to Reproduce:
Comment 1 Steve Brudenell 2009-03-17 04:33:05 UTC
Created attachment 185257 [details]
updated ebuild -- adds patches I supplied, as well as checks for CONFIG_TUN
Comment 2 Steve Brudenell 2009-03-17 04:33:50 UTC
Created attachment 185259 [details, diff]
patch to correct nstx's usage of Linux tuntap
Comment 3 Steve Brudenell 2009-03-17 04:34:17 UTC
Created attachment 185261 [details, diff]
patch to allow binding to interface names, as well as ip addresses
Comment 4 Steve Brudenell 2009-03-17 04:35:04 UTC
Created attachment 185262 [details, diff]
patch to print a warning when we couldn't write() enough bytes to the tunnel
Comment 5 Steve Brudenell 2009-03-17 04:35:34 UTC
Created attachment 185264 [details, diff]
delete the unused dwrite() function to eliminate a warning
Comment 6 Steve Brudenell 2009-03-17 04:35:56 UTC
Created attachment 185266 [details, diff]
patch to delete -Werror from the Makefile
Comment 7 Steve Brudenell 2009-03-17 04:36:22 UTC
Created attachment 185267 [details]
init.d script for nstxd
Comment 8 Steve Brudenell 2009-03-17 04:36:42 UTC
Created attachment 185268 [details]
conf.d file for nstxd
Comment 9 Steve Brudenell 2009-03-17 04:37:01 UTC
Created attachment 185269 [details]
init.d script for nstxcd
Comment 10 Steve Brudenell 2009-03-17 04:37:23 UTC
Created attachment 185271 [details]
conf.d file for nstxcd
Comment 11 Steve Brudenell 2009-03-17 04:55:01 UTC
Created attachment 185275 [details]
corrected error in nstxd init script, whoops
Comment 12 Andrew Savchenko gentoo-dev 2009-07-12 19:54:49 UTC
Thanks for your improvements, it helps me in particular with -Werror and init scripts.
I am looking forward this patchset in the portage tree.
Comment 13 svrmarty 2009-11-24 16:48:06 UTC
any news on this ?

the ebuild in portage still fails with


i686-pc-linux-gnu-gcc -march=pentium3 -O3 -pipe -fomit-frame-pointer -ggdb -Wall -Werror -Wsign-compare    -c -o nstx_tuntap.o nstx_tuntap.c
cc1: warnings being treated as errors
nstx_tuntap.c: In function 'sendtun':
nstx_tuntap.c:267: error: ignoring return value of 'write', declared with attribute warn_unused_result
make: *** [nstx_tuntap.o] Error 1
make: *** Waiting for unfinished jobs....
 *
 * ERROR: net-misc/nstx-1.1_beta6-r2 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 2511:  Called die
 * The specific snippet of code:
 *       emake CC="$(tc-getCC)" || die
 *  The die message:
 *   (no error message)
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/net-misc/nstx-1.1_beta6-r2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/net-misc/nstx-1.1_beta6-r2/temp/environment'.
 *

Comment 14 svrmarty 2009-12-01 09:38:21 UTC
ebuild works good

please commit this asap
Comment 15 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-12-06 19:39:14 UTC
Thanks Steve. Committed now.
If you want to be the maintainer, I'll proxy for you.
Comment 16 svrmarty 2010-05-18 09:41:34 UTC
please mark -r3 as stable, since -r2 still doesn't compile