Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(65)

Issue 10864044: go.net/ipv4: make setting IPv4 header flags easier

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 3 months ago by marant
Modified:
12 years, 3 months ago
Reviewers:
Visibility:
Public.

Description

go.net/ipv4: make setting IPv4 header flags easier Current implementation of Header uses Header.FragOffset to fill both flags and fragment offset fields of the IP header(total 16 bits), even though fragment offset is only 13 bits wide according to RFC791. The current implementation allows weird fragment offsets and makes setting the flags kind of nasty. This change adds a new field 'Flags' to Header which allows setting of DF and MF flags without having to manually mask the bits to Header.FragOffset. Header.Marshal takes care of the required bit shifting.

Patch Set 1 #

Patch Set 2 : diff -r 84a4013f96e0 https://code.google.com/p/go.net #

Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -4 lines) Patch
M ipv4/header.go View 1 3 chunks +7 lines, -0 lines 0 comments Download
M ipv4/header_test.go View 1 1 chunk +4 lines, -4 lines 0 comments Download

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b