Skip to content

Commit

Permalink
workaround for not always getting LOCAL port status.
Browse files Browse the repository at this point in the history
  • Loading branch information
anarkiwi committed Jul 15, 2022
1 parent f884501 commit 97bb204
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ovs/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,8 @@ func mustHandleCreateNetwork(d *Driver, opMsg DovesnapOp) {
mode := opMsg.Mode
if mode == "nat" || mode == "routed" {
netAcl := getStrForNetwork(ns.NATAcl, ns.NetworkName)
add_interfaces += d.faucetconfrpcer.vlanInterfaceYaml(ofPortLocal, "OVS Port default gateway", ns.BridgeVLAN, netAcl)
// TODO: consider the bridge port to be always up - determine why OVS doesn't always update us with port status.
add_interfaces += d.faucetconfrpcer.localVlanInterfaceYaml(ofPortLocal, "OVS Port default gateway", ns.BridgeVLAN, netAcl)
ns.DynamicNetworkStates.ExternalPorts[inspectNs.BridgeName] = getExternalPortState(inspectNs.BridgeName, ofPortLocal)
}
if usingMirrorBridge(d) {
Expand Down
4 changes: 4 additions & 0 deletions ovs/ovs_faucetconfrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ func (c *faucetconfrpcer) vlanInterfaceYaml(ofport OFPortType, description strin
return fmt.Sprintf("%d: {description: %s, native_vlan: %d, acls_in: [%s]},", ofport, description, vlan, acls_in)
}

func (c *faucetconfrpcer) localVlanInterfaceYaml(ofport OFPortType, description string, vlan uint, acls_in string) string {
return fmt.Sprintf("%d: {opstatus_reconf: False, description: %s, native_vlan: %d, acls_in: [%s]},", ofport, description, vlan, acls_in)
}

func (c *faucetconfrpcer) stackInterfaceYaml(ofport OFPortType, remoteDpName string, remoteOfport OFPortType) string {
return fmt.Sprintf("%d: {description: stack link to %s, stack: {dp: %s, port: %d}},", ofport, remoteDpName, remoteDpName, remoteOfport)
}
Expand Down

0 comments on commit 97bb204

Please sign in to comment.