diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-03-03 22:13:29 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-03-03 22:13:29 +0000 |
commit | 5f5127ba9ddb8f52d43827b6ab96b8169af5075f (patch) | |
tree | 701124de37c5bf475ba6920641948d637da0ee8b /pkg/tcpip/transport/tcp | |
parent | 56f91c540e938374a025c31cf23aa2e4d00cacec (diff) | |
parent | 844e4d284cddf9795a0db7c38f926fe7b49bb873 (diff) |
Merge release-20200219.0-91-g844e4d2 (automated)
Diffstat (limited to 'pkg/tcpip/transport/tcp')
-rwxr-xr-x | pkg/tcpip/transport/tcp/tcp_endpoint_list.go | 33 | ||||
-rwxr-xr-x | pkg/tcpip/transport/tcp/tcp_segment_list.go | 33 |
2 files changed, 42 insertions, 24 deletions
diff --git a/pkg/tcpip/transport/tcp/tcp_endpoint_list.go b/pkg/tcpip/transport/tcp/tcp_endpoint_list.go index 42e190060..32ac43dca 100755 --- a/pkg/tcpip/transport/tcp/tcp_endpoint_list.go +++ b/pkg/tcpip/transport/tcp/tcp_endpoint_list.go @@ -54,8 +54,9 @@ func (l *endpointList) Back() *endpoint { // PushFront inserts the element e at the front of list l. func (l *endpointList) PushFront(e *endpoint) { - endpointElementMapper{}.linkerFor(e).SetNext(l.head) - endpointElementMapper{}.linkerFor(e).SetPrev(nil) + linker := endpointElementMapper{}.linkerFor(e) + linker.SetNext(l.head) + linker.SetPrev(nil) if l.head != nil { endpointElementMapper{}.linkerFor(l.head).SetPrev(e) @@ -68,8 +69,9 @@ func (l *endpointList) PushFront(e *endpoint) { // PushBack inserts the element e at the back of list l. func (l *endpointList) PushBack(e *endpoint) { - endpointElementMapper{}.linkerFor(e).SetNext(nil) - endpointElementMapper{}.linkerFor(e).SetPrev(l.tail) + linker := endpointElementMapper{}.linkerFor(e) + linker.SetNext(nil) + linker.SetPrev(l.tail) if l.tail != nil { endpointElementMapper{}.linkerFor(l.tail).SetNext(e) @@ -98,10 +100,14 @@ func (l *endpointList) PushBackList(m *endpointList) { // InsertAfter inserts e after b. func (l *endpointList) InsertAfter(b, e *endpoint) { - a := endpointElementMapper{}.linkerFor(b).Next() - endpointElementMapper{}.linkerFor(e).SetNext(a) - endpointElementMapper{}.linkerFor(e).SetPrev(b) - endpointElementMapper{}.linkerFor(b).SetNext(e) + bLinker := endpointElementMapper{}.linkerFor(b) + eLinker := endpointElementMapper{}.linkerFor(e) + + a := bLinker.Next() + + eLinker.SetNext(a) + eLinker.SetPrev(b) + bLinker.SetNext(e) if a != nil { endpointElementMapper{}.linkerFor(a).SetPrev(e) @@ -112,10 +118,13 @@ func (l *endpointList) InsertAfter(b, e *endpoint) { // InsertBefore inserts e before a. func (l *endpointList) InsertBefore(a, e *endpoint) { - b := endpointElementMapper{}.linkerFor(a).Prev() - endpointElementMapper{}.linkerFor(e).SetNext(a) - endpointElementMapper{}.linkerFor(e).SetPrev(b) - endpointElementMapper{}.linkerFor(a).SetPrev(e) + aLinker := endpointElementMapper{}.linkerFor(a) + eLinker := endpointElementMapper{}.linkerFor(e) + + b := aLinker.Prev() + eLinker.SetNext(a) + eLinker.SetPrev(b) + aLinker.SetPrev(e) if b != nil { endpointElementMapper{}.linkerFor(b).SetNext(e) diff --git a/pkg/tcpip/transport/tcp/tcp_segment_list.go b/pkg/tcpip/transport/tcp/tcp_segment_list.go index 029f98a11..9b21b87ad 100755 --- a/pkg/tcpip/transport/tcp/tcp_segment_list.go +++ b/pkg/tcpip/transport/tcp/tcp_segment_list.go @@ -54,8 +54,9 @@ func (l *segmentList) Back() *segment { // PushFront inserts the element e at the front of list l. func (l *segmentList) PushFront(e *segment) { - segmentElementMapper{}.linkerFor(e).SetNext(l.head) - segmentElementMapper{}.linkerFor(e).SetPrev(nil) + linker := segmentElementMapper{}.linkerFor(e) + linker.SetNext(l.head) + linker.SetPrev(nil) if l.head != nil { segmentElementMapper{}.linkerFor(l.head).SetPrev(e) @@ -68,8 +69,9 @@ func (l *segmentList) PushFront(e *segment) { // PushBack inserts the element e at the back of list l. func (l *segmentList) PushBack(e *segment) { - segmentElementMapper{}.linkerFor(e).SetNext(nil) - segmentElementMapper{}.linkerFor(e).SetPrev(l.tail) + linker := segmentElementMapper{}.linkerFor(e) + linker.SetNext(nil) + linker.SetPrev(l.tail) if l.tail != nil { segmentElementMapper{}.linkerFor(l.tail).SetNext(e) @@ -98,10 +100,14 @@ func (l *segmentList) PushBackList(m *segmentList) { // InsertAfter inserts e after b. func (l *segmentList) InsertAfter(b, e *segment) { - a := segmentElementMapper{}.linkerFor(b).Next() - segmentElementMapper{}.linkerFor(e).SetNext(a) - segmentElementMapper{}.linkerFor(e).SetPrev(b) - segmentElementMapper{}.linkerFor(b).SetNext(e) + bLinker := segmentElementMapper{}.linkerFor(b) + eLinker := segmentElementMapper{}.linkerFor(e) + + a := bLinker.Next() + + eLinker.SetNext(a) + eLinker.SetPrev(b) + bLinker.SetNext(e) if a != nil { segmentElementMapper{}.linkerFor(a).SetPrev(e) @@ -112,10 +118,13 @@ func (l *segmentList) InsertAfter(b, e *segment) { // InsertBefore inserts e before a. func (l *segmentList) InsertBefore(a, e *segment) { - b := segmentElementMapper{}.linkerFor(a).Prev() - segmentElementMapper{}.linkerFor(e).SetNext(a) - segmentElementMapper{}.linkerFor(e).SetPrev(b) - segmentElementMapper{}.linkerFor(a).SetPrev(e) + aLinker := segmentElementMapper{}.linkerFor(a) + eLinker := segmentElementMapper{}.linkerFor(e) + + b := aLinker.Prev() + eLinker.SetNext(a) + eLinker.SetPrev(b) + aLinker.SetPrev(e) if b != nil { segmentElementMapper{}.linkerFor(b).SetNext(e) |