Fix logger check
This commit is contained in:
parent
5bb0784f61
commit
add23d4844
1 changed files with 6 additions and 2 deletions
|
|
@ -205,14 +205,18 @@ func (t *NativeTun) enableGSO() error {
|
|||
err = setTCPOffload(t.tunFd)
|
||||
if err != nil {
|
||||
if !(errors.Is(err, unix.EPERM) && t.options.FileDescriptor != 0) {
|
||||
if t.options.Logger != nil {
|
||||
t.options.Logger.Warn(E.Cause(err, "enable offload: set tcp offload"))
|
||||
}
|
||||
t.gro.disableTCPGRO()
|
||||
t.gro.disableUDPGRO()
|
||||
}
|
||||
} else {
|
||||
err = setUDPOffload(t.tunFd)
|
||||
if err != nil {
|
||||
if t.options.Logger != nil {
|
||||
t.options.Logger.Warn(E.Cause(err, "enable offload: set udp offload"))
|
||||
}
|
||||
t.gro.disableUDPGRO()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue