]> Cypherpunks.ru repositories - govpn.git/blobdiff - src/govpn/tap.go
Simplify transport packet padding scheme, save 1 byte
[govpn.git] / src / govpn / tap.go
index 9c999b41374b2750fa05490331219b388fb88107..43207c19e7cc032771d05eb27c40453fd4a4de13 100644 (file)
@@ -1,6 +1,6 @@
 /*
 GoVPN -- simple secure free software virtual private network daemon
-Copyright (C) 2014-2015 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2014-2016 Sergey Matveev <stargrave@stargrave.org>
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -42,9 +42,9 @@ var (
 )
 
 // Return maximal acceptable TAP interface MTU. This is daemon's MTU
-// minus nonce, MAC, packet size mark and Ethernet header sizes.
+// minus nonce, MAC, pad and Ethernet header sizes.
 func TAPMaxMTU() int {
-       return MTU - poly1305.TagSize - NonceSize - PktSizeSize - EtherSize
+       return MTU - poly1305.TagSize - NonceSize - 1 - EtherSize
 }
 
 func NewTAP(ifaceName string) (*TAP, error) {