feature/conn25: drop returned error from NewFlow signature
The returned error in the signature is left over from previous implementations and was only returning nil. If we know NewFlow will succeed we can fire a create hook (implemented in a future commit) before NewFlow, which will prevent a remove hook for a flow from firing before the create hook for the same flow. Updates tailscale/corp#38630 Signed-off-by: Michael Ben-Ami <mzb@tailscale.com>
This commit is contained in:
committed by
mzbenami
parent
da11aa54b7
commit
2a0eafc20f
@@ -196,7 +196,7 @@ func (t *FlowTable) lookup(k flowtrack.Tuple, dir Origin) (PacketAction, bool) {
|
||||
// would cause the table to exceed its maximum size, the least recently used
|
||||
// (looked-up or created) flow is evicted. data is not validated, the caller must
|
||||
// supply non-nil packet actions.
|
||||
func (t *FlowTable) NewFlow(data FlowData) error {
|
||||
func (t *FlowTable) NewFlow(data FlowData) {
|
||||
t.mu.Lock()
|
||||
defer t.mu.Unlock()
|
||||
|
||||
@@ -217,8 +217,6 @@ func (t *FlowTable) NewFlow(data FlowData) error {
|
||||
|
||||
t.fromTunCache[data.FromTun.Tuple] = ele
|
||||
t.fromWGCache[data.FromWG.Tuple] = ele
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// StartExpiredSweeper starts a sweeper that removes idle flows that have
|
||||
|
||||
Reference in New Issue
Block a user