slackhq / nebula

A scalable overlay networking tool with a focus on performance, simplicity and security
MIT License
14.63k stars 982 forks source link

🐛 BUG: packet loss calculation misses some loss #1255

Open brianbraunstein opened 1 month ago

brianbraunstein commented 1 month ago

What version of nebula are you using? (nebula -version)

master

What operating system are you using?

not relevant

Describe the Bug

https://github.com/slackhq/nebula/blob/3f6a7cb250a756314da65e8a440628dd94e7976f/bits.go#L66-L68

In this if statement, the b.bits entries that are being set to false should first be checked to see if any are already false, and if so the lostCounter should be incremented for each.

This means any case where you lose more than 1 packet, you risk not counting older packet loss that it skips over.

Logs from affected hosts

not relevant

Config files from affected hosts

not relevant

joehiggi1758 commented 3 weeks ago

Hello @brianbraunstein - hope you're having a wonderful day!

I'm relatively new to Nebula and Go, but stumbled upon this and would like to take a crack. I'll submit a PR shortly!