5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-26 07:11:40 +00:00

Update comments

This commit is contained in:
Neil Alexander 2019-01-21 16:24:29 +00:00
parent d3f67ad017
commit 62d4d62a77
No known key found for this signature in database
GPG Key ID: A02A2019A2BB0944

View File

@ -557,10 +557,12 @@ func (sinfo *sessionInfo) doSend(bs []byte) {
// Work out the flowkey - this is used to determine which switch queue
// traffic will be pushed to in the event of congestion
var flowkey uint64
// Get the IP protocol version from the packet
switch bs[0] & 0xf0 {
case 0x40: // IPv4 packet
// Check the packet meets minimum UDP packet length
if len(bs) >= 24 {
// Is the protocol TCP, UDP or SCTP?
if bs[9] == 0x06 || bs[9] == 0x11 || bs[9] == 0x84 {
ihl := bs[0] & 0x0f * 4 // Header length
flowkey = uint64(bs[9])<<32 /* proto */ |