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,
"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 == "" {
port.link = co.GenName("gre")
}
key, _ := strconv.Atoi(values[2])
link := &netlink.Gretap{
IKey: uint32(key),
OKey: uint32(key),
LinkAttrs: netlink.LinkAttrs{
Name: port.link,
MTU: 1460,