Removed the cookies from the remote node rules.
The rest of the ovs sdn rules had removed them in other patches.  This
catches the other cases we hadn't cleaned up.
package ovs
import (
- "encoding/hex"
"fmt"
"github.com/golang/glog"
"io/ioutil"
@@ -338,9 +337,9 @@ func (plugin *ovsPlugin) AddHostSubnetRules(subnet *osapi.HostSubnet) {
cookie := generateCookie(subnet.HostIP)
otx := ovs.NewTransaction(BR)
- otx.AddFlow("table=1, cookie=0x%s, priority=100, tun_src=%s, actions=goto_table:5", cookie, subnet.HostIP)
- otx.AddFlow("table=8, cookie=0x%s, priority=100, arp, nw_dst=%s, actions=move:NXM_NX_REG0[]->NXM_NX_TUN_ID[0..31],set_field:%s->tun_dst,output:1", cookie, subnet.Subnet, subnet.HostIP)
- otx.AddFlow("table=8, cookie=0x%s, priority=100, ip, nw_dst=%s, actions=move:NXM_NX_REG0[]->NXM_NX_TUN_ID[0..31],set_field:%s->tun_dst,output:1", cookie, subnet.Subnet, subnet.HostIP)
+ otx.AddFlow("table=1, priority=100, tun_src=%s, actions=goto_table:5", subnet.HostIP)
+ otx.AddFlow("table=8, priority=100, arp, nw_dst=%s, actions=move:NXM_NX_REG0[]->NXM_NX_TUN_ID[0..31],set_field:%s->tun_dst,output:1", subnet.Subnet, subnet.HostIP)
+ otx.AddFlow("table=8, priority=100, ip, nw_dst=%s, actions=move:NXM_NX_REG0[]->NXM_NX_TUN_ID[0..31],set_field:%s->tun_dst,output:1", subnet.Subnet, subnet.HostIP)
err := otx.EndTransaction()
if err != nil {
@@ -352,17 +351,14 @@ func (plugin *ovsPlugin) DeleteHostSubnetRules(subnet *osapi.HostSubnet) {
glog.V(5).Infof("DeleteHostSubnetRules for %v", subnet)
otx := ovs.NewTransaction(BR)
- otx.DeleteFlows("cookie=0x%s/0xffffffff", generateCookie(subnet.HostIP))
+ otx.DeleteFlows("table=1, tun_src=%s", nodeIP)
+ otx.DeleteFlows("table=8, nw_dst=%s", nodeIP)
err := otx.EndTransaction()
if err != nil {
glog.Errorf("Error deleting OVS flows: %v", err)
}
}
-func generateCookie(ip string) string {
- return hex.EncodeToString(net.ParseIP(ip).To4())
-}
-
func (plugin *ovsPlugin) AddServiceRules(service *kapi.Service, netID uint) {
if !plugin.multitenant {
return
