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