diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-03-05 20:00:16 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-03-05 20:00:16 +0000 |
commit | 3d2ce29b9e0bb834bf9327732af242340f0115cb (patch) | |
tree | 1d7ca365361a4836e5ee408fb85d0359a2ec56f6 /pkg/tcpip/network/internal | |
parent | 65d9c432c38d7dbf0f00094f70f7fb4adbb249f7 (diff) | |
parent | 3e8e2cad881978674737ee3f9ac58b780d172187 (diff) |
Merge release-20210301.0-15-g3e8e2cad8 (automated)
Diffstat (limited to 'pkg/tcpip/network/internal')
-rw-r--r-- | pkg/tcpip/network/internal/ip/duplicate_address_detection.go | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/pkg/tcpip/network/internal/ip/duplicate_address_detection.go b/pkg/tcpip/network/internal/ip/duplicate_address_detection.go index 6f89a6a16..0053646ee 100644 --- a/pkg/tcpip/network/internal/ip/duplicate_address_detection.go +++ b/pkg/tcpip/network/internal/ip/duplicate_address_detection.go @@ -126,9 +126,12 @@ func (d *DAD) CheckDuplicateAddressLocked(addr tcpip.Address, h stack.DADComplet s.timer.Stop() delete(d.addresses, addr) - r := stack.DADResult{Resolved: dadDone, Err: err} + var res stack.DADResult = &stack.DADSucceeded{} + if err != nil { + res = &stack.DADError{Err: err} + } for _, h := range s.completionHandlers { - h(r) + h(res) } }), } @@ -142,7 +145,7 @@ func (d *DAD) CheckDuplicateAddressLocked(addr tcpip.Address, h stack.DADComplet // StopLocked stops a currently running DAD process. // // Precondition: d.protocolMU must be locked. -func (d *DAD) StopLocked(addr tcpip.Address, aborted bool) { +func (d *DAD) StopLocked(addr tcpip.Address, reason stack.DADResult) { s, ok := d.addresses[addr] if !ok { return @@ -152,14 +155,8 @@ func (d *DAD) StopLocked(addr tcpip.Address, aborted bool) { s.timer.Stop() delete(d.addresses, addr) - var err tcpip.Error - if aborted { - err = &tcpip.ErrAborted{} - } - - r := stack.DADResult{Resolved: false, Err: err} for _, h := range s.completionHandlers { - h(r) + h(reason) } } |