mirror of
https://git.zx2c4.com/wireguard-go
synced 2024-11-15 01:05:15 +01:00
tun/netstack: check error returned by SetDeadline()
Signed-off-by: Alexander Neumann <alexander.neumann@redteam-pentesting.de> [Jason: don't wrap deadline error.] Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
2cec4d1a62
commit
ae6bc4dd64
@ -690,7 +690,10 @@ func (tnet *Net) exchange(ctx context.Context, server netip.Addr, q dnsmessage.Q
|
|||||||
return dnsmessage.Parser{}, dnsmessage.Header{}, err
|
return dnsmessage.Parser{}, dnsmessage.Header{}, err
|
||||||
}
|
}
|
||||||
if d, ok := ctx.Deadline(); ok && !d.IsZero() {
|
if d, ok := ctx.Deadline(); ok && !d.IsZero() {
|
||||||
c.SetDeadline(d)
|
err := c.SetDeadline(d)
|
||||||
|
if err != nil {
|
||||||
|
return dnsmessage.Parser{}, dnsmessage.Header{}, err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
var p dnsmessage.Parser
|
var p dnsmessage.Parser
|
||||||
var h dnsmessage.Header
|
var h dnsmessage.Header
|
||||||
|
Loading…
Reference in New Issue
Block a user