summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip
AgeCommit message (Collapse)Author
2020-03-13Merge release-20200219.0-168-g86409c9 (automated)gVisor bot
2020-03-13Avoid unnecessary work in transportDemuxer.deliverPacket().Jamie Liu
- Don't allocate []*endpointsByNic in transportDemuxer.deliverPacket() unless actually needed for UDP broadcast/multicast. - Don't allocate []*endpointsByNic via transportDemuxer.findEndpointLocked() => transportDemuxer.findAllEndpointsLocked(). - Skip unnecessary map lookups in transportDemuxer.findEndpointLocked() => transportDemuxer.findAllEndpointsLocked() (now iterEndpointsLocked). For most deliverable packets other than UDP broadcast/multicast packets, this saves two slice allocations and three map lookups per packet. PiperOrigin-RevId: 300804135
2020-03-13Merge release-20200219.0-162-g28d26d2 (automated)gVisor bot
2020-03-13Honour the link's MaxHeaderLength when forwardingGhanan Gowripalan
LinkEndpoints may expect/assume that the a tcpip.PacketBuffer's Header has enough capacity for its own headers, as per documentation for LinkEndpoint.MaxHeaderLength. Test: stack_test.TestNICForwarding PiperOrigin-RevId: 300784192
2020-03-13Merge release-20200219.0-160-gf693e13 (automated)gVisor bot
2020-03-12Clarify comments about IHL in ipv4.go.Eyal Soha
PiperOrigin-RevId: 300668506
2020-03-12Mark gonet_test as flaky.Zach Koopmans
Mark /pkg/tcpip/adapters/gonet/gonet_test as flaky. PiperOrigin-RevId: 300609529
2020-03-12Merge release-20200219.0-156-g035f743 (automated)gVisor bot
2020-03-11Use a heap in transport demuxerTamir Duberstein
...instead of sorting at various times. Plug a memory leak by setting removed elements to nil. PiperOrigin-RevId: 300471087
2020-03-12Merge release-20200219.0-155-gac05043 (automated)gVisor bot
2020-03-11Implement heap.Interface on pointer receiverTamir Duberstein
PiperOrigin-RevId: 300467253
2020-03-12Merge release-20200219.0-154-g538e35f (automated)gVisor bot
2020-03-11Fix race condition (*tcp.endpoint).CloseTamir Duberstein
Atomically close the endpoint. Before this change, it was possible for multiple callers to perform duplicate work. PiperOrigin-RevId: 300462110
2020-03-12Merge release-20200219.0-150-g81675b8 (automated)gVisor bot
2020-03-11Fix memory leak in danglingEndpoints.Bhasker Hariharan
Endpoints which were being terminated in an ERROR state or were moved to CLOSED by the worker goroutine do not run cleanupLocked() as that should already be run by the worker termination. But when making that change we made the mistake of not removing the endpoint from the danglingEndpoints which is normally done in cleanupLocked(). As a result these endpoints are leaked since a reference is held to them in the danglingEndpoints array forever till Stack is torn down. PiperOrigin-RevId: 300438426
2020-03-11Merge release-20200219.0-145-g2c2622b (automated)gVisor bot
2020-03-11Merge pull request #1975 from nybidari:iptablesgVisor bot
PiperOrigin-RevId: 300362789
2020-03-11Merge release-20200219.0-137-g7bca091 (automated)gVisor bot
2020-03-11Automated rollback of changelist 300217972gVisor bot
PiperOrigin-RevId: 300308974
2020-03-11Merge release-20200219.0-134-gf56fe66 (automated)gVisor bot
2020-03-10Honour the link's MaxHeaderLength when forwardingGhanan Gowripalan
This change also updates where the IP packet buffer is held in an outbound tcpip.PacketBuffer from Header to Data. This change removes unncessary copying of the IP packet buffer when forwarding. Test: stack_test.TestNICForwarding PiperOrigin-RevId: 300217972
2020-03-10Merge release-20200219.0-133-gd6440ec (automated)gVisor bot
2020-03-10The packet forwarding should resolve the link address if necessary.gVisor bot
Fixes #1510 Test: - stack_test.TestForwardingWithStaticResolver - stack_test.TestForwardingWithFakeResolver - stack_test.TestForwardingWithNoResolver - stack_test.TestForwardingWithFakeResolverPartialTimeout - stack_test.TestForwardingWithFakeResolverTwoPackets - stack_test.TestForwardingWithFakeResolverManyPackets - stack_test.TestForwardingWithFakeResolverManyResolutions PiperOrigin-RevId: 300182570
2020-03-06Merge release-20200219.0-122-g6fa5cee (automated)gVisor bot
2020-03-06Prevent memory leaks in ilistTamir Duberstein
When list elements are removed from a list but not discarded, it becomes important to invalidate the references they hold to their former neighbors to prevent memory leaks. PiperOrigin-RevId: 299412421
2020-03-06Merge release-20200219.0-117-gd5dbe36 (automated)gVisor bot
2020-03-06shutdown(s, SHUT_WR) in TIME-WAIT returns ENOTCONNEyal Soha
From RFC 793 s3.9 p61 Event Processing: CLOSE Call during TIME-WAIT: return with "error: connection closing" Fixes #1603 PiperOrigin-RevId: 299401353
2020-03-06Merge release-20200219.0-116-gf50d9a3 (automated)gVisor bot
2020-03-06Specify the source of outgoing NDP RSGhanan Gowripalan
If the NIC has a valid IPv6 address assigned, use it as the source address for outgoing NDP Router Solicitation packets. Test: stack_test.TestRouterSolicitation PiperOrigin-RevId: 299398763
2020-03-06Add nat table support for iptables.Nayana Bidari
2020-03-06Merge release-20200219.0-112-gd6f5e71 (automated)gVisor bot
2020-03-06Get strings for stack.DHCPv6ConfigurationFromNDPRAGhanan Gowripalan
Useful for logs to print the string representation of the value instead of the integer value. PiperOrigin-RevId: 299356847
2020-03-05Merge release-20200219.0-107-g9b3aad3 (automated)gVisor bot
2020-03-05Use a pool of arrays to avoid slice headers from escaping in TCP options pool.Ian Gudger
By putting slices into the pool, the slice header escapes. This can be avoided by not putting the slice header into the pool. This removes an allocation from the TCP segment send path. PiperOrigin-RevId: 299215480
2020-03-03Merge release-20200219.0-93-g371abe0 (automated)gVisor bot
2020-03-03Avoid memory leaksTamir Duberstein
Properly discard segments from the segment heap. PiperOrigin-RevId: 298704074
2020-03-03Merge release-20200219.0-91-g844e4d2 (automated)gVisor bot
2020-03-03Merge release-20200219.0-86-gc15b851 (automated)gVisor bot
2020-03-03Fix datarace on TransportEndpointInfo.ID and clean up semantics.Ian Gudger
Ensures that all access to TransportEndpointInfo.ID is either: * In a function ending in a Locked suffix. * While holding the appropriate mutex. This primary affects the checkV4Mapped method on affected endpoints, which has been renamed to checkV4MappedLocked. Also document the method and change its argument to be a value instead of a pointer which had caused some awkwardness. This race was possible in the udp and icmp endpoints between Connect and uses of TransportEndpointInfo.ID including in both itself and Bind. The tcp endpoint did not suffer from this bug, but benefited from better documentation. Updates #357 PiperOrigin-RevId: 298682913
2020-03-02Merge release-20200219.0-81-g3310175 (automated)gVisor bot
2020-03-02Fix data-race when reading/writing e.amss.Bhasker Hariharan
PiperOrigin-RevId: 298451319
2020-03-02Merge release-20200219.0-80-g8821a71 (automated)gVisor bot
2020-03-02Do not read-lock NIC recursivelyGhanan Gowripalan
A deadlock may occur if a write lock on a RWMutex is blocked between nested read lock attempts as the inner read lock attempt will be blocked in this scenario. Example (T1 and T2 are differnt goroutines): T1: obtain read-lock T2: attempt write-lock (blocks) T1: attempt inner/nested read-lock (blocks) Here we can see that T1 and T2 are deadlocked. Tests: Existing tests pass. PiperOrigin-RevId: 298426678
2020-02-28Add nat table support for iptables.Nayana Bidari
- Fix review comments.
2020-02-27Merge release-20200219.0-58-gc6bdc6b (automated)gVisor bot
2020-02-27Fix a race in TCP endpoint teardown and teardown the stack in tcp_test.Ian Gudger
Call stack.Close on stacks when we are done with them in tcp_test. This avoids leaking resources and reduces the test's flakiness when race/gotsan is enabled. It also provides test coverage for the race also fixed in this change, which can be reliably triggered with the stack.Close change (and without the other changes) when race/gotsan is enabled. The race was possible when calling Abort (via stack.Close) on an endpoint processing a SYN segment as part of a passive connect. Updates #1564 PiperOrigin-RevId: 297685432
2020-02-27Merge release-20200219.0-52-gabf7ebc (automated)gVisor bot
2020-02-27Internal change.Nayana Bidari
PiperOrigin-RevId: 297638665
2020-02-26Fix merge conflicts.Nayana Bidari
2020-02-25Merge branch 'master' into iptablesnybidari