Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 262765 - net-misc/nstx: init scripts, qa fixes, enhancements
Summary: net-misc/nstx: init scripts, qa fixes, enhancements
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 156491 260925
  Show dependency tree
 
Reported: 2009-03-17 04:31 UTC by Steve Brudenell
Modified: 2010-05-18 09:41 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
updated ebuild -- adds patches I supplied, as well as checks for CONFIG_TUN (nstx-1.1_beta6-r3.ebuild,1.47 KB, text/plain)
2009-03-17 04:33 UTC, Steve Brudenell
Details
patch to correct nstx's usage of Linux tuntap (nstx-1.1_beta6_00-linux-tuntap.patch,12.81 KB, patch)
2009-03-17 04:33 UTC, Steve Brudenell
Details | Diff
patch to allow binding to interface names, as well as ip addresses (nstx-1.1_beta6_01-bind-interface-name.patch,4.13 KB, patch)
2009-03-17 04:34 UTC, Steve Brudenell
Details | Diff
patch to print a warning when we couldn't write() enough bytes to the tunnel (nstx-1.1_beta6_02-warn-on-frag.patch,736 bytes, patch)
2009-03-17 04:35 UTC, Steve Brudenell
Details | Diff
delete the unused dwrite() function to eliminate a warning (nstx-1.1_beta6_03-delete-dwrite.patch,508 bytes, patch)
2009-03-17 04:35 UTC, Steve Brudenell
Details | Diff
patch to delete -Werror from the Makefile (nstx-1.1_beta6_04-delete-werror.patch,433 bytes, patch)
2009-03-17 04:35 UTC, Steve Brudenell
Details | Diff
init.d script for nstxd (nstxd.init,2.24 KB, text/plain)
2009-03-17 04:36 UTC, Steve Brudenell
Details
conf.d file for nstxd (nstxd.conf,1.34 KB, text/plain)
2009-03-17 04:36 UTC, Steve Brudenell
Details
init.d script for nstxcd (nstxcd.init,2.29 KB, text/plain)
2009-03-17 04:37 UTC, Steve Brudenell
Details
conf.d file for nstxcd (nstxcd.conf,2.18 KB, text/plain)
2009-03-17 04:37 UTC, Steve Brudenell
Details
corrected error in nstxd init script, whoops (nstxd.init,2.24 KB, text/plain)
2009-03-17 04:55 UTC, Steve Brudenell
Details

Note You need to log in before you can comment on or make changes to this bug.
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