Fix probe GSO
This commit is contained in:
parent
99fb96a4c8
commit
eccdcee073
1 changed files with 15 additions and 6 deletions
19
tun_linux.go
19
tun_linux.go
|
|
@ -289,6 +289,17 @@ func (t *NativeTun) Name() (string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *NativeTun) Start() 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() {
|
if t.vnetHdr && t.gro.canTCPGRO() {
|
||||||
err := t.probeTCPGRO()
|
err := t.probeTCPGRO()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -299,12 +310,10 @@ func (t *NativeTun) Start() error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if t.options.FileDescriptor != 0 {
|
|
||||||
return nil
|
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)
|
tunLink, err := netlink.LinkByName(t.options.Name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return E.Cause(err, "find tun interface")
|
return E.Cause(err, "find tun interface")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue