Skip to content

Commit

Permalink
removed old serialize code
Browse files Browse the repository at this point in the history
  • Loading branch information
garmr-ulfr committed Mar 14, 2024
1 parent 696ee65 commit 7e49f93
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions actions/tamper_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,14 +421,6 @@ func tamperTCP(tcp *layers.TCP, field TCPField, valueGen tamperValueGen) {
opt.OptionLength = uint8(tcpOptionLengths[field]) + 2
}
}

// let gopacket handle converting the modified TCP headers into []byte for us since we changed the struct fields
// instead of the underlying []byte directly. SerializeTo doesn't write the changes to the raw packet
// so we have to copy the formatted bytes back into the packet header.
sb := gopacket.NewSerializeBuffer()
tcp.SerializeTo(sb, gopacket.SerializeOptions{})
tcp.Contents = make([]byte, len(sb.Bytes()))
copy(tcp.Contents, sb.Bytes())
}

// tcpFlagsToUint32 converts a string of TCP flags to a uint32 bitmap.
Expand Down

0 comments on commit 7e49f93

Please sign in to comment.