summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGoogler <noreply@google.com>2018-11-06 11:07:25 -0800
committerShentubot <shentubot@google.com>2018-11-06 11:08:22 -0800
commit9256ed528305ab71f5acb8f1d79a2f74622f9d4c (patch)
tree2bf3969b5d51a3ff9f953b436d63bc45762d0b2d
parent86b3f0cd243918f92bd59cfc5de3204d960b5917 (diff)
Internal change.
PiperOrigin-RevId: 220314735 Change-Id: Ic519567e43f6caf042b9f223e517da40640b7d38
-rw-r--r--pkg/tcpip/header/ipv4.go5
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)