fea: switch: support key options for gretap

This commit is contained in:
Daniel Ding
2024-01-08 17:35:36 +08:00
parent 044c529532
commit 53dcac37f9
2 changed files with 4 additions and 1 deletions

View File

@@ -20,7 +20,7 @@
}, },
{ {
"vlan": 0, "vlan": 0,
"interface": "gre:3.3.3.3" "interface": "gre:3.3.3.3:55"
} }
] ]
} }

View File

@@ -159,7 +159,10 @@ func (w *WorkerImpl) AddOutput(bridge string, port *LinuxPort) {
if port.link == "" { if port.link == "" {
port.link = co.GenName("gre") port.link = co.GenName("gre")
} }
key, _ := strconv.Atoi(values[2])
link := &netlink.Gretap{ link := &netlink.Gretap{
IKey: uint32(key),
OKey: uint32(key),
LinkAttrs: netlink.LinkAttrs{ LinkAttrs: netlink.LinkAttrs{
Name: port.link, Name: port.link,
MTU: 1460, MTU: 1460,