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:
Created attachment 185257 [details] updated ebuild -- adds patches I supplied, as well as checks for CONFIG_TUN
Created attachment 185259 [details, diff] patch to correct nstx's usage of Linux tuntap
Created attachment 185261 [details, diff] patch to allow binding to interface names, as well as ip addresses
Created attachment 185262 [details, diff] patch to print a warning when we couldn't write() enough bytes to the tunnel
Created attachment 185264 [details, diff] delete the unused dwrite() function to eliminate a warning
Created attachment 185266 [details, diff] patch to delete -Werror from the Makefile
Created attachment 185267 [details] init.d script for nstxd
Created attachment 185268 [details] conf.d file for nstxd
Created attachment 185269 [details] init.d script for nstxcd
Created attachment 185271 [details] conf.d file for nstxcd
Created attachment 185275 [details] corrected error in nstxd init script, whoops
Thanks for your improvements, it helps me in particular with -Werror and init scripts. I am looking forward this patchset in the portage tree.
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'. *
ebuild works good please commit this asap
Thanks Steve. Committed now. If you want to be the maintainer, I'll proxy for you.
please mark -r3 as stable, since -r2 still doesn't compile