summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport/tcp
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-11-13 07:00:09 +0000
committergVisor bot <gvisor-bot@google.com>2020-11-13 07:00:09 +0000
commitf560fd07ef27eef3027f03e93e2c958375d60dd7 (patch)
tree38c9c19a5948edaa06ab43454fb38a96d9f9531d /pkg/tcpip/transport/tcp
parentf942d232b2c93d40a7af7007a8490c51d663e7f5 (diff)
parent5bb64ce1b8c42fcd96e44a5be05e17f34a83f840 (diff)
Merge release-20201030.0-83-g5bb64ce1b (automated)
Diffstat (limited to 'pkg/tcpip/transport/tcp')
-rw-r--r--pkg/tcpip/transport/tcp/endpoint.go20
-rw-r--r--pkg/tcpip/transport/tcp/tcp_state_autogen.go194
2 files changed, 104 insertions, 110 deletions
diff --git a/pkg/tcpip/transport/tcp/endpoint.go b/pkg/tcpip/transport/tcp/endpoint.go
index 23b9de8c5..194d3a8a4 100644
--- a/pkg/tcpip/transport/tcp/endpoint.go
+++ b/pkg/tcpip/transport/tcp/endpoint.go
@@ -440,9 +440,6 @@ type endpoint struct {
ttl uint8
v6only bool
isConnectNotified bool
- // TCP should never broadcast but Linux nevertheless supports enabling/
- // disabling SO_BROADCAST, albeit as a NOOP.
- broadcast bool
// portFlags stores the current values of port related flags.
portFlags ports.Flags
@@ -685,6 +682,9 @@ type endpoint struct {
// linger is used for SO_LINGER socket option.
linger tcpip.LingerOption
+
+ // ops is used to get socket level options.
+ ops tcpip.SocketOptions
}
// UniqueID implements stack.TransportEndpoint.UniqueID.
@@ -1599,11 +1599,6 @@ func (e *endpoint) windowCrossedACKThresholdLocked(deltaBefore int) (crossed boo
func (e *endpoint) SetSockOptBool(opt tcpip.SockOptBool, v bool) *tcpip.Error {
switch opt {
- case tcpip.BroadcastOption:
- e.LockUser()
- e.broadcast = v
- e.UnlockUser()
-
case tcpip.CorkOption:
e.LockUser()
if !v {
@@ -1950,11 +1945,6 @@ func (e *endpoint) readyReceiveSize() (int, *tcpip.Error) {
// GetSockOptBool implements tcpip.Endpoint.GetSockOptBool.
func (e *endpoint) GetSockOptBool(opt tcpip.SockOptBool) (bool, *tcpip.Error) {
switch opt {
- case tcpip.BroadcastOption:
- e.LockUser()
- v := e.broadcast
- e.UnlockUser()
- return v, nil
case tcpip.CorkOption:
return atomic.LoadUint32(&e.cork) != 0, nil
@@ -3130,3 +3120,7 @@ func (e *endpoint) Wait() {
<-notifyCh
}
}
+
+func (e *endpoint) SocketOptions() *tcpip.SocketOptions {
+ return &e.ops
+}
diff --git a/pkg/tcpip/transport/tcp/tcp_state_autogen.go b/pkg/tcpip/transport/tcp/tcp_state_autogen.go
index 8782316f2..2a2960d80 100644
--- a/pkg/tcpip/transport/tcp/tcp_state_autogen.go
+++ b/pkg/tcpip/transport/tcp/tcp_state_autogen.go
@@ -176,7 +176,6 @@ func (e *endpoint) StateFields() []string {
"ttl",
"v6only",
"isConnectNotified",
- "broadcast",
"portFlags",
"boundBindToDevice",
"boundPortFlags",
@@ -224,6 +223,7 @@ func (e *endpoint) StateFields() []string {
"txHash",
"owner",
"linger",
+ "ops",
}
}
@@ -234,9 +234,9 @@ func (e *endpoint) StateSave(stateSinkObject state.Sink) {
var stateValue EndpointState = e.saveState()
stateSinkObject.SaveValue(11, stateValue)
var recentTSTimeValue unixTime = e.saveRecentTSTime()
- stateSinkObject.SaveValue(26, recentTSTimeValue)
+ stateSinkObject.SaveValue(25, recentTSTimeValue)
var acceptedChanValue []*endpoint = e.saveAcceptedChan()
- stateSinkObject.SaveValue(52, acceptedChanValue)
+ stateSinkObject.SaveValue(51, acceptedChanValue)
stateSinkObject.Save(0, &e.EndpointInfo)
stateSinkObject.Save(1, &e.waiterQueue)
stateSinkObject.Save(2, &e.uniqueID)
@@ -251,52 +251,52 @@ func (e *endpoint) StateSave(stateSinkObject state.Sink) {
stateSinkObject.Save(13, &e.ttl)
stateSinkObject.Save(14, &e.v6only)
stateSinkObject.Save(15, &e.isConnectNotified)
- stateSinkObject.Save(16, &e.broadcast)
- stateSinkObject.Save(17, &e.portFlags)
- stateSinkObject.Save(18, &e.boundBindToDevice)
- stateSinkObject.Save(19, &e.boundPortFlags)
- stateSinkObject.Save(20, &e.boundDest)
- stateSinkObject.Save(21, &e.effectiveNetProtos)
- stateSinkObject.Save(22, &e.workerRunning)
- stateSinkObject.Save(23, &e.workerCleanup)
- stateSinkObject.Save(24, &e.sendTSOk)
- stateSinkObject.Save(25, &e.recentTS)
- stateSinkObject.Save(27, &e.tsOffset)
- stateSinkObject.Save(28, &e.shutdownFlags)
- stateSinkObject.Save(29, &e.sackPermitted)
- stateSinkObject.Save(30, &e.sack)
- stateSinkObject.Save(31, &e.bindToDevice)
- stateSinkObject.Save(32, &e.delay)
- stateSinkObject.Save(33, &e.cork)
- stateSinkObject.Save(34, &e.scoreboard)
- stateSinkObject.Save(35, &e.slowAck)
- stateSinkObject.Save(36, &e.segmentQueue)
- stateSinkObject.Save(37, &e.synRcvdCount)
- stateSinkObject.Save(38, &e.userMSS)
- stateSinkObject.Save(39, &e.maxSynRetries)
- stateSinkObject.Save(40, &e.windowClamp)
- stateSinkObject.Save(41, &e.sndBufSize)
- stateSinkObject.Save(42, &e.sndBufUsed)
- stateSinkObject.Save(43, &e.sndClosed)
- stateSinkObject.Save(44, &e.sndBufInQueue)
- stateSinkObject.Save(45, &e.sndQueue)
- stateSinkObject.Save(46, &e.cc)
- stateSinkObject.Save(47, &e.packetTooBigCount)
- stateSinkObject.Save(48, &e.sndMTU)
- stateSinkObject.Save(49, &e.keepalive)
- stateSinkObject.Save(50, &e.userTimeout)
- stateSinkObject.Save(51, &e.deferAccept)
- stateSinkObject.Save(53, &e.rcv)
- stateSinkObject.Save(54, &e.snd)
- stateSinkObject.Save(55, &e.connectingAddress)
- stateSinkObject.Save(56, &e.amss)
- stateSinkObject.Save(57, &e.sendTOS)
- stateSinkObject.Save(58, &e.gso)
- stateSinkObject.Save(59, &e.tcpLingerTimeout)
- stateSinkObject.Save(60, &e.closed)
- stateSinkObject.Save(61, &e.txHash)
- stateSinkObject.Save(62, &e.owner)
- stateSinkObject.Save(63, &e.linger)
+ stateSinkObject.Save(16, &e.portFlags)
+ stateSinkObject.Save(17, &e.boundBindToDevice)
+ stateSinkObject.Save(18, &e.boundPortFlags)
+ stateSinkObject.Save(19, &e.boundDest)
+ stateSinkObject.Save(20, &e.effectiveNetProtos)
+ stateSinkObject.Save(21, &e.workerRunning)
+ stateSinkObject.Save(22, &e.workerCleanup)
+ stateSinkObject.Save(23, &e.sendTSOk)
+ stateSinkObject.Save(24, &e.recentTS)
+ stateSinkObject.Save(26, &e.tsOffset)
+ stateSinkObject.Save(27, &e.shutdownFlags)
+ stateSinkObject.Save(28, &e.sackPermitted)
+ stateSinkObject.Save(29, &e.sack)
+ stateSinkObject.Save(30, &e.bindToDevice)
+ stateSinkObject.Save(31, &e.delay)
+ stateSinkObject.Save(32, &e.cork)
+ stateSinkObject.Save(33, &e.scoreboard)
+ stateSinkObject.Save(34, &e.slowAck)
+ stateSinkObject.Save(35, &e.segmentQueue)
+ stateSinkObject.Save(36, &e.synRcvdCount)
+ stateSinkObject.Save(37, &e.userMSS)
+ stateSinkObject.Save(38, &e.maxSynRetries)
+ stateSinkObject.Save(39, &e.windowClamp)
+ stateSinkObject.Save(40, &e.sndBufSize)
+ stateSinkObject.Save(41, &e.sndBufUsed)
+ stateSinkObject.Save(42, &e.sndClosed)
+ stateSinkObject.Save(43, &e.sndBufInQueue)
+ stateSinkObject.Save(44, &e.sndQueue)
+ stateSinkObject.Save(45, &e.cc)
+ stateSinkObject.Save(46, &e.packetTooBigCount)
+ stateSinkObject.Save(47, &e.sndMTU)
+ stateSinkObject.Save(48, &e.keepalive)
+ stateSinkObject.Save(49, &e.userTimeout)
+ stateSinkObject.Save(50, &e.deferAccept)
+ stateSinkObject.Save(52, &e.rcv)
+ stateSinkObject.Save(53, &e.snd)
+ stateSinkObject.Save(54, &e.connectingAddress)
+ stateSinkObject.Save(55, &e.amss)
+ stateSinkObject.Save(56, &e.sendTOS)
+ stateSinkObject.Save(57, &e.gso)
+ stateSinkObject.Save(58, &e.tcpLingerTimeout)
+ stateSinkObject.Save(59, &e.closed)
+ stateSinkObject.Save(60, &e.txHash)
+ stateSinkObject.Save(61, &e.owner)
+ stateSinkObject.Save(62, &e.linger)
+ stateSinkObject.Save(63, &e.ops)
}
func (e *endpoint) StateLoad(stateSourceObject state.Source) {
@@ -314,56 +314,56 @@ func (e *endpoint) StateLoad(stateSourceObject state.Source) {
stateSourceObject.Load(13, &e.ttl)
stateSourceObject.Load(14, &e.v6only)
stateSourceObject.Load(15, &e.isConnectNotified)
- stateSourceObject.Load(16, &e.broadcast)
- stateSourceObject.Load(17, &e.portFlags)
- stateSourceObject.Load(18, &e.boundBindToDevice)
- stateSourceObject.Load(19, &e.boundPortFlags)
- stateSourceObject.Load(20, &e.boundDest)
- stateSourceObject.Load(21, &e.effectiveNetProtos)
- stateSourceObject.Load(22, &e.workerRunning)
- stateSourceObject.Load(23, &e.workerCleanup)
- stateSourceObject.Load(24, &e.sendTSOk)
- stateSourceObject.Load(25, &e.recentTS)
- stateSourceObject.Load(27, &e.tsOffset)
- stateSourceObject.Load(28, &e.shutdownFlags)
- stateSourceObject.Load(29, &e.sackPermitted)
- stateSourceObject.Load(30, &e.sack)
- stateSourceObject.Load(31, &e.bindToDevice)
- stateSourceObject.Load(32, &e.delay)
- stateSourceObject.Load(33, &e.cork)
- stateSourceObject.Load(34, &e.scoreboard)
- stateSourceObject.Load(35, &e.slowAck)
- stateSourceObject.LoadWait(36, &e.segmentQueue)
- stateSourceObject.Load(37, &e.synRcvdCount)
- stateSourceObject.Load(38, &e.userMSS)
- stateSourceObject.Load(39, &e.maxSynRetries)
- stateSourceObject.Load(40, &e.windowClamp)
- stateSourceObject.Load(41, &e.sndBufSize)
- stateSourceObject.Load(42, &e.sndBufUsed)
- stateSourceObject.Load(43, &e.sndClosed)
- stateSourceObject.Load(44, &e.sndBufInQueue)
- stateSourceObject.LoadWait(45, &e.sndQueue)
- stateSourceObject.Load(46, &e.cc)
- stateSourceObject.Load(47, &e.packetTooBigCount)
- stateSourceObject.Load(48, &e.sndMTU)
- stateSourceObject.Load(49, &e.keepalive)
- stateSourceObject.Load(50, &e.userTimeout)
- stateSourceObject.Load(51, &e.deferAccept)
- stateSourceObject.LoadWait(53, &e.rcv)
- stateSourceObject.LoadWait(54, &e.snd)
- stateSourceObject.Load(55, &e.connectingAddress)
- stateSourceObject.Load(56, &e.amss)
- stateSourceObject.Load(57, &e.sendTOS)
- stateSourceObject.Load(58, &e.gso)
- stateSourceObject.Load(59, &e.tcpLingerTimeout)
- stateSourceObject.Load(60, &e.closed)
- stateSourceObject.Load(61, &e.txHash)
- stateSourceObject.Load(62, &e.owner)
- stateSourceObject.Load(63, &e.linger)
+ stateSourceObject.Load(16, &e.portFlags)
+ stateSourceObject.Load(17, &e.boundBindToDevice)
+ stateSourceObject.Load(18, &e.boundPortFlags)
+ stateSourceObject.Load(19, &e.boundDest)
+ stateSourceObject.Load(20, &e.effectiveNetProtos)
+ stateSourceObject.Load(21, &e.workerRunning)
+ stateSourceObject.Load(22, &e.workerCleanup)
+ stateSourceObject.Load(23, &e.sendTSOk)
+ stateSourceObject.Load(24, &e.recentTS)
+ stateSourceObject.Load(26, &e.tsOffset)
+ stateSourceObject.Load(27, &e.shutdownFlags)
+ stateSourceObject.Load(28, &e.sackPermitted)
+ stateSourceObject.Load(29, &e.sack)
+ stateSourceObject.Load(30, &e.bindToDevice)
+ stateSourceObject.Load(31, &e.delay)
+ stateSourceObject.Load(32, &e.cork)
+ stateSourceObject.Load(33, &e.scoreboard)
+ stateSourceObject.Load(34, &e.slowAck)
+ stateSourceObject.LoadWait(35, &e.segmentQueue)
+ stateSourceObject.Load(36, &e.synRcvdCount)
+ stateSourceObject.Load(37, &e.userMSS)
+ stateSourceObject.Load(38, &e.maxSynRetries)
+ stateSourceObject.Load(39, &e.windowClamp)
+ stateSourceObject.Load(40, &e.sndBufSize)
+ stateSourceObject.Load(41, &e.sndBufUsed)
+ stateSourceObject.Load(42, &e.sndClosed)
+ stateSourceObject.Load(43, &e.sndBufInQueue)
+ stateSourceObject.LoadWait(44, &e.sndQueue)
+ stateSourceObject.Load(45, &e.cc)
+ stateSourceObject.Load(46, &e.packetTooBigCount)
+ stateSourceObject.Load(47, &e.sndMTU)
+ stateSourceObject.Load(48, &e.keepalive)
+ stateSourceObject.Load(49, &e.userTimeout)
+ stateSourceObject.Load(50, &e.deferAccept)
+ stateSourceObject.LoadWait(52, &e.rcv)
+ stateSourceObject.LoadWait(53, &e.snd)
+ stateSourceObject.Load(54, &e.connectingAddress)
+ stateSourceObject.Load(55, &e.amss)
+ stateSourceObject.Load(56, &e.sendTOS)
+ stateSourceObject.Load(57, &e.gso)
+ stateSourceObject.Load(58, &e.tcpLingerTimeout)
+ stateSourceObject.Load(59, &e.closed)
+ stateSourceObject.Load(60, &e.txHash)
+ stateSourceObject.Load(61, &e.owner)
+ stateSourceObject.Load(62, &e.linger)
+ stateSourceObject.Load(63, &e.ops)
stateSourceObject.LoadValue(3, new(string), func(y interface{}) { e.loadLastError(y.(string)) })
stateSourceObject.LoadValue(11, new(EndpointState), func(y interface{}) { e.loadState(y.(EndpointState)) })
- stateSourceObject.LoadValue(26, new(unixTime), func(y interface{}) { e.loadRecentTSTime(y.(unixTime)) })
- stateSourceObject.LoadValue(52, new([]*endpoint), func(y interface{}) { e.loadAcceptedChan(y.([]*endpoint)) })
+ stateSourceObject.LoadValue(25, new(unixTime), func(y interface{}) { e.loadRecentTSTime(y.(unixTime)) })
+ stateSourceObject.LoadValue(51, new([]*endpoint), func(y interface{}) { e.loadAcceptedChan(y.([]*endpoint)) })
stateSourceObject.AfterLoad(e.afterLoad)
}