[PATCH 7/7] tun_darwin: adapt to TUNDevice interface change

Simon Ruderich simon at ruderich.org
Mon Jan 1 12:14:36 CET 2018

On Sun, Dec 31, 2017 at 08:17:58PM +0100, Mathias Hall-Andersen wrote:
> Hi Simon
> Thanks for your patches!

Hi Mathias,

Thanks for your quick response.

> I am still fixing the interface up / down semantics (stopping / starting
> peer timers and routines not needed when the interface is down).
> I hope to fix this and merge your linux code in the next couple of days.
> This should bring us very close to a usable linux client.


I just sent out a second set of patches with stuff I noticed
while reading the code (I only stumbled over the TUN code when I
tried to run the test suite).

While I'm at I have a few questions about the code (zx2c4 said I
should ask here):

conn_linux.go: DstToBytes() uses end.src, however DstIP() uses
end.dst. Is this a typo?

device.go: removePeerUnsafe() doesn't unlock the peer mutex. Is
this intended? If so a comment would be nice.

ratelimiter.go: RoutineGarbageCollector() uses time.Second as
magic value, maybe use RatelimiterGarbageCollectTime or a new
constant instead?

receive.go: RoutineHandshake() returns on some errors (e.g.
"Failed to decode cookie reply" or mac failure), shouldn't it
continue instead?

timers.go: TimerEphemeralKeyCreated() uses 3 as magic value
(multiplied by RejectAfterTime), why 3?

daemon_darwin.go, daemon_windows.go: the Daemonize() function
uses a different signature so the build will fail on those
systems (but I think there are more compile errors on non linux).

+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.zx2c4.com/pipermail/wireguard/attachments/20180101/e3ae84a6/attachment.asc>

More information about the WireGuard mailing list