diff options
author | sobomax <sobomax@FreeBSD.org> | 2005-04-17 18:49:07 +0800 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2005-04-17 18:49:07 +0800 |
commit | 8e041424f2b54bb0918d9dcb8e41db1dd8dd8cc4 (patch) | |
tree | 2e2a96db06d48cdf765ead0b471cfb7b9eafbee9 /net | |
parent | 2441f3177f070eda931d788176c6fbc82ae95091 (diff) | |
download | freebsd-ports-gnome-8e041424f2b54bb0918d9dcb8e41db1dd8dd8cc4.tar.gz freebsd-ports-gnome-8e041424f2b54bb0918d9dcb8e41db1dd8dd8cc4.tar.zst freebsd-ports-gnome-8e041424f2b54bb0918d9dcb8e41db1dd8dd8cc4.zip |
Update to 0.94.
Diffstat (limited to 'net')
-rw-r--r-- | net/stund/Makefile | 12 | ||||
-rw-r--r-- | net/stund/distinfo | 4 | ||||
-rw-r--r-- | net/stund/files/patch-server.cxx | 62 | ||||
-rw-r--r-- | net/stund/files/patch-stun.cxx | 64 |
4 files changed, 114 insertions, 28 deletions
diff --git a/net/stund/Makefile b/net/stund/Makefile index 0291cb4d501f..92ca32c9dd49 100644 --- a/net/stund/Makefile +++ b/net/stund/Makefile @@ -6,11 +6,11 @@ # PORTNAME= stund -PORTVERSION= 0.92 +PORTVERSION= 0.94 CATEGORIES= net MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= stun -DISTNAME= ${PORTNAME}_${PORTVERSION}_Jun06 +DISTNAME= ${PORTNAME}_${PORTVERSION}_Oct29 EXTRACT_SUFX= .tgz MAINTAINER= sobomax@FreeBSD.org @@ -20,14 +20,8 @@ WRKSRC= ${WRKDIR}/${PORTNAME} USE_GMAKE= yes -.include <bsd.port.pre.mk> - -.if ${ARCH} != "i386" -BROKEN= "Does not compile on !i386" -.endif - do-install: ${INSTALL_PROGRAM} ${WRKSRC}/server ${LOCALBASE}/sbin/stund ${INSTALL_PROGRAM} ${WRKSRC}/client ${LOCALBASE}/bin/stun_client -.include <bsd.port.post.mk> +.include <bsd.port.mk> diff --git a/net/stund/distinfo b/net/stund/distinfo index cc1faa15df58..9d9099c52ef3 100644 --- a/net/stund/distinfo +++ b/net/stund/distinfo @@ -1,2 +1,2 @@ -MD5 (stund_0.92_Jun06.tgz) = bdf6c54a217d5696c84c783655636833 -SIZE (stund_0.92_Jun06.tgz) = 82725 +MD5 (stund_0.94_Oct29.tgz) = 5c5b1b206c9f9d8fdbb826a83da1fb0e +SIZE (stund_0.94_Oct29.tgz) = 84641 diff --git a/net/stund/files/patch-server.cxx b/net/stund/files/patch-server.cxx index 461a769b0831..67cab2ac850d 100644 --- a/net/stund/files/patch-server.cxx +++ b/net/stund/files/patch-server.cxx @@ -1,23 +1,51 @@ $FreeBSD$ ---- server.cxx 2004/06/10 15:25:17 1.1 -+++ server.cxx 2004/06/10 15:26:05 -@@ -172,7 +172,7 @@ - #if defined(WIN32) - int pid=0; - +--- server.cxx.orig ++++ server.cxx +@@ -32,7 +32,7 @@ + << " -a sets the secondary IP" << endl + << " -p sets the primary port and defaults to 3478" << endl + << " -o sets the secondary port and defaults to 3479" << endl +- << " -b makes the program run in the backgroud" << endl ++ << " -b makes the program run in the background" << endl + << " -m sets up a STERN server starting at port m" << endl + << " -v runs in verbose mode" << endl + // in makefile too +@@ -188,30 +188,14 @@ + //exit(1); + } + +-#if defined(WIN32) +- int pid=0; +- - if ( background ) -+ if ( !background ) - { - cerr << "The -b background option does not work in windows" << endl; - exit(-1); -@@ -180,7 +180,7 @@ - #else - pid_t pid=0; - +- { +- cerr << "The -b background option does not work in windows" << endl; +- exit(-1); +- } +-#else +- pid_t pid=0; +- - if ( background ) -+ if ( !background ) - { - pid_t pid = fork(); +- { +- pid = fork(); +- +- if (pid < 0) +- { +- cerr << "fork: unable to fork" << endl; +- exit(-1); +- } ++ if (background) { ++ if (daemon(0,0) < 0) { ++ cerr << "demon() call failed" << endl; ++ exit(1); ++ } + } +-#endif +- if (pid == 0) //child or not using background ++ if (1) //child or not using background + { + StunServerInfo info; + bool ok = stunInitServer(info, myAddr, altAddr, myMediaPort, verbose); diff --git a/net/stund/files/patch-stun.cxx b/net/stund/files/patch-stun.cxx new file mode 100644 index 000000000000..66bc71a300ca --- /dev/null +++ b/net/stund/files/patch-stun.cxx @@ -0,0 +1,64 @@ + +$FreeBSD$ + +--- stun.cxx.orig ++++ stun.cxx +@@ -648,55 +648,11 @@ + stunRand() + { + // return 32 bits of random stuff +- assert( sizeof(int) == 4 ); + static bool init=false; + if ( !init ) +- { +- init = true; +- +- UInt64 tick; +- +-#if defined(WIN32) +- volatile unsigned int lowtick=0,hightick=0; +- __asm +- { +- rdtsc +- mov lowtick, eax +- mov hightick, edx +- } +- tick = hightick; +- tick <<= 32; +- tick |= lowtick; +-#elif defined(__GNUC__) && ( defined(__i686__) || defined(__i386__) ) +- asm("rdtsc" : "=A" (tick)); +-#elif defined (__SUNPRO_CC) || defined( __sparc__ ) +- tick = gethrtime(); +-#elif defined(__MACH__) +- int fd=open("/dev/random",O_RDONLY); +- read(fd,&tick,sizeof(tick)); +- closesocket(fd); +-#else +-# error Need some way to seed the random number generator +-#endif +- int seed = int(tick); +-#ifdef WIN32 +- srand(seed); +-#else +- srandom(seed); +-#endif +- } +- +-#ifdef WIN32 +- assert( RAND_MAX == 0x7fff ); +- int r1 = rand(); +- int r2 = rand(); +- +- int ret = (r1<<16) + r2; +- +- return ret; +-#else +- return random(); +-#endif ++ srandomdev(); ++ /* random() is described as returning 0...2**31-1 */ ++ return 0xffffffff & ( ( random() << 31 ) | random() ); + } + + |