aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/stund/Makefile1
-rw-r--r--net/stund/files/patch-server.cxx2
-rw-r--r--net/stund/files/patch-stun.cxx13
3 files changed, 9 insertions, 7 deletions
diff --git a/net/stund/Makefile b/net/stund/Makefile
index 92ca32c9dd49..d6eff7e28322 100644
--- a/net/stund/Makefile
+++ b/net/stund/Makefile
@@ -7,6 +7,7 @@
PORTNAME= stund
PORTVERSION= 0.94
+PORTREVISION= 1
CATEGORIES= net
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= stun
diff --git a/net/stund/files/patch-server.cxx b/net/stund/files/patch-server.cxx
index 67cab2ac850d..d732ccdff85b 100644
--- a/net/stund/files/patch-server.cxx
+++ b/net/stund/files/patch-server.cxx
@@ -38,7 +38,7 @@ $FreeBSD$
- }
+ if (background) {
+ if (daemon(0,0) < 0) {
-+ cerr << "demon() call failed" << endl;
++ cerr << "daemon() call failed" << endl;
+ exit(1);
+ }
}
diff --git a/net/stund/files/patch-stun.cxx b/net/stund/files/patch-stun.cxx
index 66bc71a300ca..7e5f00c3aea5 100644
--- a/net/stund/files/patch-stun.cxx
+++ b/net/stund/files/patch-stun.cxx
@@ -1,17 +1,19 @@
$FreeBSD$
---- stun.cxx.orig
+--- stun.cxx
+++ stun.cxx
-@@ -648,55 +648,11 @@
+@@ -648,55 +648,13 @@
stunRand()
{
// return 32 bits of random stuff
- assert( sizeof(int) == 4 );
static bool init=false;
- if ( !init )
+- if ( !init )
- {
-- init = true;
++ if ( !init ) {
++ srandomdev();
+ init = true;
-
- UInt64 tick;
-
@@ -43,7 +45,7 @@ $FreeBSD$
-#else
- srandom(seed);
-#endif
-- }
+ }
-
-#ifdef WIN32
- assert( RAND_MAX == 0x7fff );
@@ -56,7 +58,6 @@ $FreeBSD$
-#else
- return random();
-#endif
-+ srandomdev();
+ /* random() is described as returning 0...2**31-1 */
+ return 0xffffffff & ( ( random() << 31 ) | random() );
}