device: add ID to repeated routines

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld
2021-05-07 12:21:21 +02:00
parent 326aec10af
commit 7121927b87
3 changed files with 13 additions and 13 deletions

View File

@@ -362,12 +362,12 @@ func calculatePaddingSize(packetSize, mtu int) int {
*
* Obs. One instance per core
*/
func (device *Device) RoutineEncryption() {
func (device *Device) RoutineEncryption(id int) {
var paddingZeros [PaddingMultiple]byte
var nonce [chacha20poly1305.NonceSize]byte
defer device.log.Verbosef("Routine: encryption worker - stopped")
device.log.Verbosef("Routine: encryption worker - started")
defer device.log.Verbosef("Routine: encryption worker %d - stopped", id)
device.log.Verbosef("Routine: encryption worker %d - started", id)
for elem := range device.queue.encryption.c {
// populate header fields