From a0a8c86ca8c6b370391150779efa461011403b57 Mon Sep 17 00:00:00 2001 From: "Stuart D. Gathman" Date: Mon, 18 Apr 2016 23:33:48 -0400 Subject: [PATCH 1/8] Put back nodejs_arches that got lost --- cjdns.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cjdns.spec b/cjdns.spec index e7b0855..06df494 100644 --- a/cjdns.spec +++ b/cjdns.spec @@ -104,6 +104,8 @@ Requires(postun): systemd %endif Requires(pre): shadow-utils Provides: bundled(libuv) = 0.11.4 +# build system requires nodejs, unfortunately +ExclusiveArch: %{nodejs_arches} %description Cjdns implements an encrypted IPv6 network using public-key cryptography for From 1257fc8db940ad8192fda8fbca08c9bbd7672aee Mon Sep 17 00:00:00 2001 From: "Stuart D. Gathman" Date: Tue, 3 May 2016 22:15:18 -0400 Subject: [PATCH 2/8] Fix caps on cjdns name. --- cjdns.man.patch | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/cjdns.man.patch b/cjdns.man.patch index 1b03fc8..3e2e7f8 100644 --- a/cjdns.man.patch +++ b/cjdns.man.patch @@ -1,6 +1,6 @@ diff -up ./contrib/doc/cjdns-online.md.man ./contrib/doc/cjdns-online.md ---- ./contrib/doc/cjdns-online.md.man 2016-04-18 15:53:17.346245693 -0400 -+++ ./contrib/doc/cjdns-online.md 2016-04-18 15:53:17.346245693 -0400 +--- ./contrib/doc/cjdns-online.md.man 2016-05-03 22:06:45.843528959 -0400 ++++ ./contrib/doc/cjdns-online.md 2016-05-03 22:06:45.843528959 -0400 @@ -0,0 +1,33 @@ +cjdns-online(1) -- check whether cjdns tunnel devices are available +============================================= @@ -36,8 +36,8 @@ diff -up ./contrib/doc/cjdns-online.md.man ./contrib/doc/cjdns-online.md + Wait for full startup instead of just tun dev. This is not implemented. + diff -up ./contrib/doc/cjdroute.md.man ./contrib/doc/cjdroute.md ---- ./contrib/doc/cjdroute.md.man 2016-04-18 15:53:17.346245693 -0400 -+++ ./contrib/doc/cjdroute.md 2016-04-18 15:53:17.346245693 -0400 +--- ./contrib/doc/cjdroute.md.man 2016-05-03 22:06:45.844528970 -0400 ++++ ./contrib/doc/cjdroute.md 2016-05-03 22:06:45.843528959 -0400 @@ -0,0 +1,76 @@ +cjdroute(1) -- Cjdns packet switch +============================================= @@ -116,8 +116,8 @@ diff -up ./contrib/doc/cjdroute.md.man ./contrib/doc/cjdroute.md + +For more information about other functions and non-standard setups, see README.md diff -up ./contrib/doc/makekeys.md.man ./contrib/doc/makekeys.md ---- ./contrib/doc/makekeys.md.man 2016-04-18 15:53:17.346245693 -0400 -+++ ./contrib/doc/makekeys.md 2016-04-18 15:53:17.346245693 -0400 +--- ./contrib/doc/makekeys.md.man 2016-05-03 22:06:45.844528970 -0400 ++++ ./contrib/doc/makekeys.md 2016-05-03 22:06:45.844528970 -0400 @@ -0,0 +1,18 @@ +makekeys(1) -- write cjdns keys generated via libnacl to stdout +============================================= @@ -138,8 +138,8 @@ diff -up ./contrib/doc/makekeys.md.man ./contrib/doc/makekeys.md + +publictoip6(1) diff -up ./contrib/doc/peerStats.md.man ./contrib/doc/peerStats.md ---- ./contrib/doc/peerStats.md.man 2016-04-18 16:56:16.630871236 -0400 -+++ ./contrib/doc/peerStats.md 2016-04-18 17:05:51.504311727 -0400 +--- ./contrib/doc/peerStats.md.man 2016-05-03 22:06:45.844528970 -0400 ++++ ./contrib/doc/peerStats.md 2016-05-03 22:06:45.844528970 -0400 @@ -0,0 +1,25 @@ +peerStats(1) -- show cjdns peers +============================================= @@ -167,8 +167,8 @@ diff -up ./contrib/doc/peerStats.md.man ./contrib/doc/peerStats.md + +cjdroute(1), sessionStats(1) diff -up ./contrib/doc/privatetopublic.md.man ./contrib/doc/privatetopublic.md ---- ./contrib/doc/privatetopublic.md.man 2016-04-18 15:53:17.346245693 -0400 -+++ ./contrib/doc/privatetopublic.md 2016-04-18 15:53:17.346245693 -0400 +--- ./contrib/doc/privatetopublic.md.man 2016-05-03 22:06:45.844528970 -0400 ++++ ./contrib/doc/privatetopublic.md 2016-05-03 22:06:45.844528970 -0400 @@ -0,0 +1,25 @@ +privatetopublic(8) -- convert cjdns private keys to public keys and IP6 +============================================= @@ -196,8 +196,8 @@ diff -up ./contrib/doc/privatetopublic.md.man ./contrib/doc/privatetopublic.md + +publictoip6(1) diff -up ./contrib/doc/publictoip6.md.man ./contrib/doc/publictoip6.md ---- ./contrib/doc/publictoip6.md.man 2016-04-18 15:53:17.346245693 -0400 -+++ ./contrib/doc/publictoip6.md 2016-04-18 15:53:17.346245693 -0400 +--- ./contrib/doc/publictoip6.md.man 2016-05-03 22:06:45.844528970 -0400 ++++ ./contrib/doc/publictoip6.md 2016-05-03 22:06:45.844528970 -0400 @@ -0,0 +1,14 @@ +publictoip6(1) -- write random bytes generated via libnacl to stdout +============================================= @@ -214,8 +214,8 @@ diff -up ./contrib/doc/publictoip6.md.man ./contrib/doc/publictoip6.md + +randombytes(1) diff -up ./contrib/doc/randombytes.md.man ./contrib/doc/randombytes.md ---- ./contrib/doc/randombytes.md.man 2016-04-18 15:53:17.346245693 -0400 -+++ ./contrib/doc/randombytes.md 2016-04-18 15:53:17.346245693 -0400 +--- ./contrib/doc/randombytes.md.man 2016-05-03 22:06:45.844528970 -0400 ++++ ./contrib/doc/randombytes.md 2016-05-03 22:06:45.844528970 -0400 @@ -0,0 +1,16 @@ +randombytes(1) -- write random bytes generated via libnacl to stdout +============================================= @@ -234,8 +234,8 @@ diff -up ./contrib/doc/randombytes.md.man ./contrib/doc/randombytes.md + +makekeys(1) diff -up ./contrib/doc/sessionStats.md.man ./contrib/doc/sessionStats.md ---- ./contrib/doc/sessionStats.md.man 2016-04-18 15:53:17.347245712 -0400 -+++ ./contrib/doc/sessionStats.md 2016-04-18 15:53:17.347245712 -0400 +--- ./contrib/doc/sessionStats.md.man 2016-05-03 22:06:45.844528970 -0400 ++++ ./contrib/doc/sessionStats.md 2016-05-03 22:09:39.354511569 -0400 @@ -0,0 +1,39 @@ +sessionStats(1) -- show cjdns crypto sessions +============================================= @@ -251,7 +251,7 @@ diff -up ./contrib/doc/sessionStats.md.man ./contrib/doc/sessionStats.md +but also when talking to intermediate nodes to ask them about their peers +when planning a route. + -+The Cjdns protocol offers Perfect Forward Secrecy. Each session has a random ++The cjdns protocol offers Perfect Forward Secrecy. Each session has a random +symmetric key that encrypts that session. If a node is compromised, +the attacker can get the session keys and read current and future sessions. +However, the session keys are securely erased when a session is destroyed, @@ -277,8 +277,8 @@ diff -up ./contrib/doc/sessionStats.md.man ./contrib/doc/sessionStats.md + +cjdroute(1), peerStats(1) diff -up ./contrib/doc/sybilsim.md.man ./contrib/doc/sybilsim.md ---- ./contrib/doc/sybilsim.md.man 2016-04-18 15:53:17.347245712 -0400 -+++ ./contrib/doc/sybilsim.md 2016-04-18 15:53:17.347245712 -0400 +--- ./contrib/doc/sybilsim.md.man 2016-05-03 22:06:45.844528970 -0400 ++++ ./contrib/doc/sybilsim.md 2016-05-03 22:06:45.844528970 -0400 @@ -0,0 +1,43 @@ +sybilsim(8) -- Cjdns packet switch +============================================= @@ -324,10 +324,10 @@ diff -up ./contrib/doc/sybilsim.md.man ./contrib/doc/sybilsim.md + +makekeys(1), cjdroute(1) diff -up ./contrib/doc/traceroute.md.man ./contrib/doc/traceroute.md ---- ./contrib/doc/traceroute.md.man 2016-04-18 15:53:17.347245712 -0400 -+++ ./contrib/doc/traceroute.md 2016-04-18 15:53:17.347245712 -0400 +--- ./contrib/doc/traceroute.md.man 2016-05-03 22:06:45.844528970 -0400 ++++ ./contrib/doc/traceroute.md 2016-05-03 22:10:00.344748050 -0400 @@ -0,0 +1,33 @@ -+cjdns-traceroute(1) -- trace Cjdns packet routing ++cjdns-traceroute(1) -- trace cjdns packet routing +============================================= + +## SYNOPSIS @@ -336,7 +336,7 @@ diff -up ./contrib/doc/traceroute.md.man ./contrib/doc/traceroute.md + +## DESCRIPTION + -+Because CJDNS is end to end encrypted, the standard traceroute always ++Because cjdns is end to end encrypted, the standard traceroute always +shows a direct connection. Cjdns-traceroute queries cjdroute to discover +what route would be used to send a packet to the destination IP. +Note that just as with the standard traceroute, there is no guarantee From 8431b667170c06ae1a286a8bcf2ee9ac4c4fe564 Mon Sep 17 00:00:00 2001 From: "Stuart D. Gathman" Date: Tue, 3 May 2016 22:53:03 -0400 Subject: [PATCH 3/8] Fix systemd/upstart to run cjdroute when *not* in openvz. :-P --- cjdns.sbin.patch | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/cjdns.sbin.patch b/cjdns.sbin.patch index 697f48f..ac13b37 100644 --- a/cjdns.sbin.patch +++ b/cjdns.sbin.patch @@ -1,6 +1,6 @@ diff -up ./contrib/systemd/cjdns-online.sh.sbin ./contrib/systemd/cjdns-online.sh ---- ./contrib/systemd/cjdns-online.sh.sbin 2016-04-18 15:53:17.316245094 -0400 -+++ ./contrib/systemd/cjdns-online.sh 2016-04-18 15:53:17.316245094 -0400 +--- ./contrib/systemd/cjdns-online.sh.sbin 2016-05-03 22:06:45.820528693 -0400 ++++ ./contrib/systemd/cjdns-online.sh 2016-05-03 22:06:45.820528693 -0400 @@ -0,0 +1,75 @@ +#!/bin/sh +# Check whether cjdns IPs are available @@ -78,8 +78,8 @@ diff -up ./contrib/systemd/cjdns-online.sh.sbin ./contrib/systemd/cjdns-online.s + cjdns_ips +fi diff -up ./contrib/systemd/cjdns-resume.service.sbin ./contrib/systemd/cjdns-resume.service ---- ./contrib/systemd/cjdns-resume.service.sbin 2016-04-18 15:53:17.316245094 -0400 -+++ ./contrib/systemd/cjdns-resume.service 2016-04-18 15:53:17.316245094 -0400 +--- ./contrib/systemd/cjdns-resume.service.sbin 2016-05-03 22:06:45.820528693 -0400 ++++ ./contrib/systemd/cjdns-resume.service 2016-05-03 22:06:45.820528693 -0400 @@ -0,0 +1,10 @@ +[Unit] +Description=Restart cjdns on resume from sleep @@ -93,8 +93,8 @@ diff -up ./contrib/systemd/cjdns-resume.service.sbin ./contrib/systemd/cjdns-res +WantedBy=sleep.target diff -up ./contrib/systemd/cjdns.service.sbin ./contrib/systemd/cjdns.service --- ./contrib/systemd/cjdns.service.sbin 2016-01-27 03:07:49.000000000 -0500 -+++ ./contrib/systemd/cjdns.service 2016-04-18 15:55:59.579483155 -0400 -@@ -9,10 +9,10 @@ ProtectSystem=true ++++ ./contrib/systemd/cjdns.service 2016-05-03 22:50:07.241986902 -0400 +@@ -9,10 +9,11 @@ ProtectSystem=true SyslogIdentifier=cjdroute ExecStartPre=/bin/sh -ec "if ! test -s /etc/cjdroute.conf; \ then umask 077; \ @@ -103,14 +103,15 @@ diff -up ./contrib/systemd/cjdns.service.sbin ./contrib/systemd/cjdns.service echo 'WARNING: A new /etc/cjdroute.conf file has been generated.'; \ - fi" -ExecStart=/bin/sh -c "exec cjdroute --nobg < /etc/cjdroute.conf" -+ fi; test -c /dev/net/tun || /usr/sbin/modprobe tun" ++ fi; case $(wc -c /proc/modules) in \ ++ 0*) ;; *) /sbin/modprobe tun;; esac" +ExecStart=/bin/sh -c "exec /usr/sbin/cjdroute --nobg < /etc/cjdroute.conf" Restart=always [Install] diff -up ./contrib/systemd/cjdns-wait-online.service.sbin ./contrib/systemd/cjdns-wait-online.service ---- ./contrib/systemd/cjdns-wait-online.service.sbin 2016-04-18 15:53:17.317245114 -0400 -+++ ./contrib/systemd/cjdns-wait-online.service 2016-04-18 15:53:17.317245114 -0400 +--- ./contrib/systemd/cjdns-wait-online.service.sbin 2016-05-03 22:06:45.820528693 -0400 ++++ ./contrib/systemd/cjdns-wait-online.service 2016-05-03 22:06:45.820528693 -0400 @@ -0,0 +1,13 @@ +[Unit] +Description=CJDNS Wait Online @@ -127,8 +128,8 @@ diff -up ./contrib/systemd/cjdns-wait-online.service.sbin ./contrib/systemd/cjdn +WantedBy=multi-user.target diff -up ./contrib/upstart/cjdns.conf.sbin ./contrib/upstart/cjdns.conf --- ./contrib/upstart/cjdns.conf.sbin 2016-01-27 03:07:49.000000000 -0500 -+++ ./contrib/upstart/cjdns.conf 2016-04-18 15:55:07.845450771 -0400 -@@ -13,10 +13,13 @@ pre-start script ++++ ./contrib/upstart/cjdns.conf 2016-05-03 22:45:32.931860381 -0400 +@@ -13,10 +13,16 @@ pre-start script if ! [ -s /etc/cjdroute.conf ]; then ( # start a subshell to avoid side effects of umask later on umask 077 # to create the file with 600 permissions without races @@ -139,11 +140,14 @@ diff -up ./contrib/upstart/cjdns.conf.sbin ./contrib/upstart/cjdns.conf echo 'WARNING: A new cjdns cjdroute.conf file has been generated.' fi + # preload tun driver, since we prevent module_request -+ test -c /dev/net/tun || /sbin/modprobe tun ++ case $(wc -c /proc/modules) in ++ 0*) ;; ++ *) /sbin/modprobe tun;; ++ esac # If you need a non-standard setup, as described in # https://github.com/cjdelisle/cjdns#non-standard-setups, -@@ -25,4 +28,4 @@ pre-start script +@@ -25,4 +31,4 @@ pre-start script # see http://upstart.ubuntu.com/cookbook/#setuid end script From 660fe4a4cbd13a463e9d346dd26cc777b18b57b1 Mon Sep 17 00:00:00 2001 From: "Stuart D. Gathman" Date: Tue, 3 May 2016 23:34:17 -0400 Subject: [PATCH 4/8] Add cjdnslog man page. --- cjdns.man.patch | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/cjdns.man.patch b/cjdns.man.patch index 3e2e7f8..ca86612 100644 --- a/cjdns.man.patch +++ b/cjdns.man.patch @@ -1,3 +1,50 @@ +diff -up ./contrib/doc/cjdnslog.md.man ./contrib/doc/cjdnslog.md +--- ./contrib/doc/cjdnslog.md.man 2016-05-03 22:57:12.839792004 -0400 ++++ ./contrib/doc/cjdnslog.md 2016-05-03 23:32:31.331738554 -0400 +@@ -0,0 +1,43 @@ ++cjdnslog(1) -- display cjdroute log messages ++============================================= ++ ++## SYNOPSIS ++ ++`/usr/bin/cjdnslog` [...] ++ ++## DESCRIPTION ++ ++Cjdroute sends continuous log messages to the bit bucket. Cjdnslog ++captures that information in real time and sends it to stdout. ++ ++##OPTIONS ++ ++With no options, cjdnslog logs everything. ++ ++ * `--help`: ++ Print usage summary. ++ ++ * `-f` source_file.c ++ Restrict output to log messages generated in source_file.c. ++ ++ * `-v` log_level: ++ Restrict output to messages at log_level or higher. Log levels ++ include DEBUG, INFO, WARN, ERROR. ++ ++ * `-l` lineno: ++ Restrict output to message generated on source line lineno. Normally ++ used in conjunction with `-f`. ++ ++##USAGE ++ ++Running cjdnslog requires admin privilege. The cjdnsadmin lib will ++try to read `/etc/cjdroute.conf` for the admin password. This will ++normally succeed only for root. Otherwise, it tries `~/.cjdnsadmin` ++ ++##FILES ++ ++`~/.cjdnsadmin` ++ ++## SEE ALSO ++ ++cjdroute(1) diff -up ./contrib/doc/cjdns-online.md.man ./contrib/doc/cjdns-online.md --- ./contrib/doc/cjdns-online.md.man 2016-05-03 22:06:45.843528959 -0400 +++ ./contrib/doc/cjdns-online.md 2016-05-03 22:06:45.843528959 -0400 From f1d325dc5147436aab86ceae36ac3fadfb1322b5 Mon Sep 17 00:00:00 2001 From: "Stuart D. Gathman" Date: Tue, 3 May 2016 23:44:29 -0400 Subject: [PATCH 5/8] Release 17.3-13 --- cjdns.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cjdns.spec b/cjdns.spec index 06df494..373aba9 100644 --- a/cjdns.spec +++ b/cjdns.spec @@ -39,7 +39,7 @@ Name: cjdns # major version is cjdns protocol version: Version: 17.3 -Release: 12%{?dist} +Release: 13%{?dist} Summary: The privacy-friendly network without borders Group: System Environment/Base # cjdns is all GPLv3 except libuv which is MIT and BSD and ISC @@ -469,6 +469,10 @@ fi %{_bindir}/graphStats %changelog +* Tue May 3 2016 Stuart D. Gathman 17.3-13 +- man page for cjdnslog +- Fix running on Fedora as well as openVZ. :-P + * Mon Apr 18 2016 Stuart D. Gathman 17.3-12 - Run modprobe only if /dev/tun not present - fixes running on openVZ - Select nacl/libsodium with a macro From 2e3ea39f136c45a821a0f8e227070e1355b3761f Mon Sep 17 00:00:00 2001 From: "Stuart D. Gathman" Date: Tue, 3 May 2016 23:49:35 -0400 Subject: [PATCH 6/8] Install cjdnslog man page --- cjdns.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/cjdns.spec b/cjdns.spec index 373aba9..2fdbe09 100644 --- a/cjdns.spec +++ b/cjdns.spec @@ -430,6 +430,7 @@ fi %{_mandir}/man1/cjdns-traceroute.1.gz %{_mandir}/man1/sessionStats.1.gz %{_mandir}/man1/peerStats.1.gz +%{_mandir}/man1/cjdnslog.1.gz %files python %doc contrib/python/README.md contrib/python/cjdns-dynamic.conf From 2183a3c262a2d4e78af079c69b6cd25b2b2c4bb0 Mon Sep 17 00:00:00 2001 From: "Stuart D. Gathman" Date: Tue, 3 May 2016 23:58:25 -0400 Subject: [PATCH 7/8] Formatting tweaks for cjdnslog man page --- cjdns.man.patch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cjdns.man.patch b/cjdns.man.patch index ca86612..c0f8cf6 100644 --- a/cjdns.man.patch +++ b/cjdns.man.patch @@ -1,6 +1,6 @@ diff -up ./contrib/doc/cjdnslog.md.man ./contrib/doc/cjdnslog.md --- ./contrib/doc/cjdnslog.md.man 2016-05-03 22:57:12.839792004 -0400 -+++ ./contrib/doc/cjdnslog.md 2016-05-03 23:32:31.331738554 -0400 ++++ ./contrib/doc/cjdnslog.md 2016-05-03 23:57:42.922419017 -0400 @@ -0,0 +1,43 @@ +cjdnslog(1) -- display cjdroute log messages +============================================= @@ -18,17 +18,17 @@ diff -up ./contrib/doc/cjdnslog.md.man ./contrib/doc/cjdnslog.md + +With no options, cjdnslog logs everything. + -+ * `--help`: ++ * `--help` + Print usage summary. + -+ * `-f` source_file.c ++ * `-f source_file.c` + Restrict output to log messages generated in source_file.c. + -+ * `-v` log_level: ++ * `-v log_level` + Restrict output to messages at log_level or higher. Log levels + include DEBUG, INFO, WARN, ERROR. + -+ * `-l` lineno: ++ * `-l lineno` + Restrict output to message generated on source line lineno. Normally + used in conjunction with `-f`. + From 264d6d9caf9845180344d2caf00ebd137882ce27 Mon Sep 17 00:00:00 2001 From: "Stuart D. Gathman" Date: Mon, 9 May 2016 16:33:56 -0400 Subject: [PATCH 8/8] Fix js-random --- cjdns.warnings.patch | 46 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/cjdns.warnings.patch b/cjdns.warnings.patch index ecd43a5..62b4860 100644 --- a/cjdns.warnings.patch +++ b/cjdns.warnings.patch @@ -1,6 +1,6 @@ diff -up ./crypto/CryptoAuth.c.warnings ./crypto/CryptoAuth.c ---- ./crypto/CryptoAuth.c.warnings 2016-04-06 00:40:48.537753854 -0400 -+++ ./crypto/CryptoAuth.c 2016-04-06 00:52:00.506042569 -0400 +--- ./crypto/CryptoAuth.c.warnings 2016-01-27 03:07:49.000000000 -0500 ++++ ./crypto/CryptoAuth.c 2016-05-03 22:06:45.842528947 -0400 @@ -77,6 +77,8 @@ static inline void getSharedSecret(uint8 uint8_t passwordHash[32], struct Log* logger) @@ -20,7 +20,7 @@ diff -up ./crypto/CryptoAuth.c.warnings ./crypto/CryptoAuth.c printHexPubKey(myPublicKeyHex, myPrivateKey); diff -up ./dht/CJDHTConstants.h.warnings ./dht/CJDHTConstants.h --- ./dht/CJDHTConstants.h.warnings 2016-01-27 03:07:49.000000000 -0500 -+++ ./dht/CJDHTConstants.h 2016-04-06 00:23:39.784334020 -0400 ++++ ./dht/CJDHTConstants.h 2016-05-03 22:06:45.842528947 -0400 @@ -17,7 +17,9 @@ #include "benc/String.h" @@ -41,7 +41,7 @@ diff -up ./dht/CJDHTConstants.h.warnings ./dht/CJDHTConstants.h #endif diff -up ./node_build/dependencies/libuv/test/test-getsockname.c.warnings ./node_build/dependencies/libuv/test/test-getsockname.c --- ./node_build/dependencies/libuv/test/test-getsockname.c.warnings 2016-01-27 03:07:49.000000000 -0500 -+++ ./node_build/dependencies/libuv/test/test-getsockname.c 2016-04-06 00:23:39.784334020 -0400 ++++ ./node_build/dependencies/libuv/test/test-getsockname.c 2016-05-03 22:06:45.842528947 -0400 @@ -18,7 +18,7 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. @@ -51,9 +51,43 @@ diff -up ./node_build/dependencies/libuv/test/test-getsockname.c.warnings ./node #include "uv.h" #include "task.h" +diff -up ./util/Constant.js.warnings ./util/Constant.js +--- ./util/Constant.js.warnings 2016-05-09 16:26:54.865933415 -0400 ++++ ./util/Constant.js 2016-05-09 16:30:00.541056943 -0400 +@@ -62,20 +62,23 @@ var base2 = module.exports.base2 = funct + return '((' + type + ') 0x' + base2ToHex(numStr) + ((type === 'uint64_t') ? 'ull' : 'ul') + ')'; + }; + ++var randomHex = function (bytes) { ++ var hex = ''; ++ var len = Number(bytes * 2); // One byte is two hex digits ++ while (hex.length < len) { hex += Math.random().toString(16).substring(2); } ++ return hex.substring(0,len); ++}; ++ + var rand64 = module.exports.rand64 = function () { +- return '((uint64_t) 0x' + +- (Math.random().toString(16) + Math.random().toString(16)).replace(/0\./g, '') + 'ull)'; ++ return '((uint64_t) 0x' + randomHex(64 / 8) + 'ull)'; + }; + + var rand32 = module.exports.rand32 = function () { +- return '((uint32_t) 0x' + Math.random().toString(16).replace(/0\./g, '') + 'ul)'; ++ return '((uint32_t) 0x' + randomHex(32 / 8) + 'ul)'; + }; + + var randHexString = module.exports.randHexString = function (lenStr) { +- var hex = ''; +- var len = Number(lenStr); +- while (hex.length < len) { hex += Math.random().toString(16).substring(2); } +- return '"' + hex.substring(0,len) + '"'; ++ return '"' + randomHex(lenStr / 2) + '"'; + }; + + var log2 = module.exports.log2 = function (val) { diff -up ./util/platform/netdev/NetPlatform_linux.c.warnings ./util/platform/netdev/NetPlatform_linux.c --- ./util/platform/netdev/NetPlatform_linux.c.warnings 2016-01-27 03:07:49.000000000 -0500 -+++ ./util/platform/netdev/NetPlatform_linux.c 2016-04-06 00:23:39.784334020 -0400 ++++ ./util/platform/netdev/NetPlatform_linux.c 2016-05-03 22:06:45.842528947 -0400 @@ -142,7 +142,7 @@ void NetPlatform_addAddress(const char* Except_throw(eh, "ioctl(SIOCSIFADDR) failed: [%s]", strerror(err)); } @@ -74,7 +108,7 @@ diff -up ./util/platform/netdev/NetPlatform_linux.c.warnings ./util/platform/net diff -up ./util/platform/Sockaddr.c.warnings ./util/platform/Sockaddr.c --- ./util/platform/Sockaddr.c.warnings 2016-01-27 03:07:49.000000000 -0500 -+++ ./util/platform/Sockaddr.c 2016-04-06 00:23:39.785334040 -0400 ++++ ./util/platform/Sockaddr.c 2016-05-03 22:06:45.842528947 -0400 @@ -12,6 +12,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see .