From 62d4d62a775ca2ff624f76d2e02ea46c1628dc2d Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Mon, 21 Jan 2019 16:24:29 +0000 Subject: [PATCH] Update comments --- src/yggdrasil/session.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/yggdrasil/session.go b/src/yggdrasil/session.go index 23b27a3..6b7f62d 100644 --- a/src/yggdrasil/session.go +++ b/src/yggdrasil/session.go @@ -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 */ |