Browse Source

FIX ovs-ofctl command for ipv6 rules

The correct format for specifing a ipv6 address in
an openflow rule is to use the ipv6_src or ipv6_dst
keywords.

if nw_dst or nw_src are used instead, the agent report
an ERROR when applying flows with message:

"Stderr: ovs-ofctl: -:3: fe80::/64: invalid IP address"
when a port is created or updated.

Change-Id: Ie318f9a3914940894112aacd1b8c25fed1b593f5
Adolfo Duarte 11 months ago
parent
commit
08e41bebf9
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      networking_vsphere/drivers/ovs_firewall.py

+ 4
- 2
networking_vsphere/drivers/ovs_firewall.py View File

@@ -555,10 +555,12 @@ class OVSFirewallDriver(firewall.FirewallDriver):
555 555
             # Fill the src and dest IPs match params.
556 556
             src_ip_prefixlen = self._get_net_prefix_len(src_ip_prefix)
557 557
             if src_ip_prefixlen > 0:
558
-                flow["nw_src"] = src_ip_prefix
558
+                _field = "ipv6_src" if ethertype == "IPv6" else "nw_src"
559
+                flow[_field] = src_ip_prefix
559 560
             dest_ip_prefixlen = self._get_net_prefix_len(dest_ip_prefix)
560 561
             if dest_ip_prefixlen > 0:
561
-                flow["nw_dst"] = dest_ip_prefix
562
+                _field = "ipv6_dst" if ethertype == "IPv6" else "nw_dst"
563
+                flow[_field] = dest_ip_prefix
562 564
             # Fill the protocol related  match params.
563 565
             protocols = self._get_protocol(ethertype, proto)
564 566
             protocol = protocols[0]

Loading…
Cancel
Save