mirror of
https://github.com/luscis/openlan.git
synced 2025-10-06 09:06:54 +08:00
fix: noudpsum for vxlan.
This commit is contained in:
@@ -3,6 +3,7 @@ package cswitch
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -184,20 +185,20 @@ func (w *WorkerImpl) addOutput(bridge string, port *co.Output) {
|
|||||||
mtu = 1450
|
mtu = 1450
|
||||||
link := &LinuxLink{
|
link := &LinuxLink{
|
||||||
link: &nl.Vxlan{
|
link: &nl.Vxlan{
|
||||||
VxlanId: port.Segment,
|
|
||||||
LinkAttrs: nl.LinkAttrs{
|
LinkAttrs: nl.LinkAttrs{
|
||||||
TxQLen: -1,
|
Name: port.Link,
|
||||||
Name: port.Link,
|
|
||||||
MTU: mtu,
|
|
||||||
},
|
},
|
||||||
Group: libol.ParseAddr(port.Remote),
|
|
||||||
Port: dport,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
if err := link.Start(); err != nil {
|
opts := []string{"type", "vxlan",
|
||||||
w.out.Error("WorkerImpl.LinkStart %s %s", port.Id(), err)
|
"id", strconv.Itoa(port.Segment), "remote", port.Remote,
|
||||||
|
"dstport", strconv.Itoa(dport), "noudpcsum"}
|
||||||
|
_, err := libol.IpLinkAdd(port.Link, opts...)
|
||||||
|
if err != nil {
|
||||||
|
w.out.Error("WorkerImpl.LinkStart %s %v", port.Id(), opts)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
libol.IpLinkSet(port.Link, "mtu", strconv.Itoa(mtu))
|
||||||
port.Linker = link
|
port.Linker = link
|
||||||
} else if port.Protocol == "tcp" || port.Protocol == "tls" ||
|
} else if port.Protocol == "tcp" || port.Protocol == "tls" ||
|
||||||
port.Protocol == "wss" {
|
port.Protocol == "wss" {
|
||||||
|
Reference in New Issue
Block a user