Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/net/ipv4: No easy way to set header flags #6453

Closed
gopherbot opened this issue Sep 23, 2013 · 2 comments
Closed

x/net/ipv4: No easy way to set header flags #6453

gopherbot opened this issue Sep 23, 2013 · 2 comments

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Sep 23, 2013

by Marko.Silokunnas:

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.
@gopherbot
Copy link
Author

@gopherbot gopherbot commented Sep 23, 2013

Comment 1 by Marko.Silokunnas:

I wrote a patch that adds the Flags field to the header:
https://golang.org/cl/13832043

@mikioh
Copy link
Contributor

@mikioh mikioh commented Oct 7, 2013

Comment 2:

This issue was closed by revision golang/net@c2e426e.

Status changed to Fixed.

@mikioh mikioh added repo-net and removed repo-net labels Dec 23, 2014
@mikioh mikioh changed the title go.net/ipv4: No easy way to set header flags ipv4: No easy way to set header flags Jan 4, 2015
@mikioh mikioh changed the title ipv4: No easy way to set header flags x/net/ipv4: No easy way to set header flags Jul 20, 2015
@golang golang locked and limited conversation to collaborators Jul 20, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants