diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-04-01 02:55:29 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-04-01 02:55:29 +0000 |
commit | bbba7a4527f117b6e4a3fe64e816b3e9ef4a6300 (patch) | |
tree | d2313744450dd547f44fc1677601bd6bb9b2eaa4 | |
parent | 3fa968f7a5d62f5d667925e5fe579634b38520a4 (diff) | |
parent | d25036ad17a3ada7fa6ce9900f20e246e07acd2f (diff) |
Merge release-20200323.0-44-gd25036a (automated)
-rw-r--r-- | pkg/tcpip/header/udp.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/tcpip/header/udp.go b/pkg/tcpip/header/udp.go index 74412c894..9339d637f 100644 --- a/pkg/tcpip/header/udp.go +++ b/pkg/tcpip/header/udp.go @@ -99,6 +99,11 @@ func (b UDP) SetChecksum(checksum uint16) { binary.BigEndian.PutUint16(b[udpChecksum:], checksum) } +// SetLength sets the "length" field of the udp header. +func (b UDP) SetLength(length uint16) { + binary.BigEndian.PutUint16(b[udpLength:], length) +} + // CalculateChecksum calculates the checksum of the udp packet, given the // checksum of the network-layer pseudo-header and the checksum of the payload. func (b UDP) CalculateChecksum(partialChecksum uint16) uint16 { |