From 9256ed528305ab71f5acb8f1d79a2f74622f9d4c Mon Sep 17 00:00:00 2001 From: Googler Date: Tue, 6 Nov 2018 11:07:25 -0800 Subject: Internal change. PiperOrigin-RevId: 220314735 Change-Id: Ic519567e43f6caf042b9f223e517da40640b7d38 --- pkg/tcpip/header/ipv4.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pkg/tcpip') diff --git a/pkg/tcpip/header/ipv4.go b/pkg/tcpip/header/ipv4.go index 1b882d3d8..c3b8fb00e 100644 --- a/pkg/tcpip/header/ipv4.go +++ b/pkg/tcpip/header/ipv4.go @@ -211,6 +211,11 @@ func (b IPv4) SetFlagsFragmentOffset(flags uint8, offset uint16) { binary.BigEndian.PutUint16(b[flagsFO:], v) } +// SetID sets the identification field. +func (b IPv4) SetID(v uint16) { + binary.BigEndian.PutUint16(b[id:], v) +} + // SetSourceAddress sets the "source address" field of the ipv4 header. func (b IPv4) SetSourceAddress(addr tcpip.Address) { copy(b[srcAddr:srcAddr+IPv4AddressSize], addr) -- cgit v1.2.3