diff options
author | Googler <noreply@google.com> | 2018-11-06 11:07:25 -0800 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-11-06 11:08:22 -0800 |
commit | 9256ed528305ab71f5acb8f1d79a2f74622f9d4c (patch) | |
tree | 2bf3969b5d51a3ff9f953b436d63bc45762d0b2d /pkg/tcpip/header/ipv4.go | |
parent | 86b3f0cd243918f92bd59cfc5de3204d960b5917 (diff) |
Internal change.
PiperOrigin-RevId: 220314735
Change-Id: Ic519567e43f6caf042b9f223e517da40640b7d38
Diffstat (limited to 'pkg/tcpip/header/ipv4.go')
-rw-r--r-- | pkg/tcpip/header/ipv4.go | 5 |
1 files changed, 5 insertions, 0 deletions
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) |