summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/header
diff options
context:
space:
mode:
authorKevin Krakauer <krakauer@google.com>2020-09-29 23:20:08 -0700
committergVisor bot <gvisor-bot@google.com>2020-09-29 23:21:46 -0700
commit3ef549b67f83fdbc1c7aa30c2b8531f38419461e (patch)
treeaa3809349f6bbd336c8fd39e9c8e0e0cfc6f0421 /pkg/tcpip/header
parent0aae51c6e09046e56f2d4b6064124da059731286 (diff)
Set transport protocol number during parsing
PiperOrigin-RevId: 334535896
Diffstat (limited to 'pkg/tcpip/header')
-rw-r--r--pkg/tcpip/header/parse/parse.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/pkg/tcpip/header/parse/parse.go b/pkg/tcpip/header/parse/parse.go
index 522135557..5ca75c834 100644
--- a/pkg/tcpip/header/parse/parse.go
+++ b/pkg/tcpip/header/parse/parse.go
@@ -139,6 +139,7 @@ traverseExtensions:
// Returns true if the header was successfully parsed.
func UDP(pkt *stack.PacketBuffer) bool {
_, ok := pkt.TransportHeader().Consume(header.UDPMinimumSize)
+ pkt.TransportProtocolNumber = header.UDPProtocolNumber
return ok
}
@@ -162,5 +163,6 @@ func TCP(pkt *stack.PacketBuffer) bool {
}
_, ok = pkt.TransportHeader().Consume(hdrLen)
+ pkt.TransportProtocolNumber = header.TCPProtocolNumber
return ok
}