Fix probe GSO

This commit is contained in:
世界 2026-07-11 15:27:57 +08:00
parent 99fb96a4c8
commit eccdcee073
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -289,6 +289,17 @@ func (t *NativeTun) Name() (string, error) {
}
func (t *NativeTun) Start() error {
if t.options.FileDescriptor == 0 {
if !t.options.EXP_ExternalConfiguration {
t.options.InterfaceMonitor.RegisterMyInterface(t.options.Name)
}
err := t.start()
if err != nil {
return err
}
}
// The kernel rejects writes with EIO while the device is not up (tun_get_user),
// so the probe must run after LinkSetUp.
if t.vnetHdr && t.gro.canTCPGRO() {
err := t.probeTCPGRO()
if err != nil {
@ -299,12 +310,10 @@ func (t *NativeTun) Start() error {
}
}
}
if t.options.FileDescriptor != 0 {
return nil
}
if !t.options.EXP_ExternalConfiguration {
t.options.InterfaceMonitor.RegisterMyInterface(t.options.Name)
}
}
func (t *NativeTun) start() error {
tunLink, err := netlink.LinkByName(t.options.Name)
if err != nil {
return E.Cause(err, "find tun interface")