diff --git a/tun_linux.go b/tun_linux.go index 8e1e5d5..ac36af2 100644 --- a/tun_linux.go +++ b/tun_linux.go @@ -148,7 +148,9 @@ func (t *NativeTun) configure(tunLink netlink.Link) error { if t.options.GSO { err = t.enableGSO() if err != nil { - t.options.Logger.Warn(err) + if t.options.Logger != nil { + t.options.Logger.Warn(err) + } } } @@ -275,7 +277,9 @@ func (t *NativeTun) Start() error { if err != nil { t.gro.disableTCPGRO() t.gro.disableUDPGRO() - t.options.Logger.Warn(E.Cause(err, "disabled TUN TCP & UDP GRO due to GRO probe error")) + if t.options.Logger != nil { + t.options.Logger.Warn(E.Cause(err, "disabled TUN TCP & UDP GRO due to GRO probe error")) + } } }