Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ovs/vswitch.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@ type InterfaceOptions struct {
// tunneled traffic leaving this interface. Optionally it could be set to
// "flow" which expects the flow to set tunnel ID.
Key string

// Optionally compute encapsulation header (either GRE or UDP) checksums on
// outgoing packets. Default is false, set to true to enable. Checksums present
// on incoming packets will be validated regardless of this setting.
Csum string
}

// slice creates a string slice containing any non-zero option values from the
Expand Down Expand Up @@ -315,5 +320,9 @@ func (i InterfaceOptions) slice() []string {
s = append(s, fmt.Sprintf("options:key=%s", i.Key))
}

if i.Csum != "" {
s = append(s, fmt.Sprintf("options:csum=%s", i.Csum))
}

return s
}
15 changes: 15 additions & 0 deletions ovs/vswitch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,21 @@ func TestInterfaceOptions_slice(t *testing.T) {
"options:key=flow",
},
},
{
desc: "flow based VXLAN tunnel",
i: InterfaceOptions{
Type: InterfaceTypeVXLAN,
RemoteIP: "flow",
Key: "flow",
Csum: "true",
},
out: []string{
"type=vxlan",
"options:remote_ip=flow",
"options:key=flow",
"options:csum=true",
},
},
{
desc: "all options",
i: InterfaceOptions{
Expand Down