Current implementation of ipv4.Header doesn't have an easy way to set flags
of the header. RFC791 defines that the flags field of the header is 3 bits
wide and the fragment offset field is 13 bits wide. In the current implementation
of ipv4.Header fragment offset is defined as an int and marshaled into a 16 bit
wide field in Marshal(). This allows the flags to be set by manually using bitwise
operations, but it is rather ugly.
I propose that a Flags field should be added to ipv4.Header and the marshalling
and unmarshalling functions should take care of the rest.
The text was updated successfully, but these errors were encountered: