Internal change.

PiperOrigin-RevId: 220314735
Change-Id: Ic519567e43f6caf042b9f223e517da40640b7d38
This commit is contained in:
Googler
2018-11-06 11:08:22 -08:00
committed by Shentubot
parent 86b3f0cd24
commit 9256ed5283
+5
View File
@@ -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)