[ovs-dev] [PATCH v3, 6/7] ovn-northd: add Router Advertisement packet forward flow

Zongkai LI zealokii at gmail.com
Fri Oct 14 03:57:20 UTC 2016


This patch add lflow support for Router Advertisement packet forward.
Forward RA packets to router port in lswitch l2_lkup table.

Signed-off-by: Zongkai LI <zealokii at gmail.com>
---
 ovn/northd/ovn-northd.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c
index 9d74ec6..093d5ff 100644
--- a/ovn/northd/ovn-northd.c
+++ b/ovn/northd/ovn-northd.c
@@ -3051,6 +3051,32 @@ build_lswitch_flows(struct hmap *datapaths, struct hmap *ports,
         ovn_lflow_add(lflows, od, S_SWITCH_IN_DHCP_RESPONSE, 0, "1", "next;");
     }
 
+    /* Ingress table 13: Destination lookup, router solicitation handling
+     * (priority 110). */
+    HMAP_FOR_EACH (od, key_node, datapaths) {
+        if (!od->nbs) {
+            continue;
+        }
+
+        if (!od->n_router_ports) {
+            continue;
+        }
+
+        ds_clear(&actions);
+        for (size_t i = 0; i != od->n_router_ports; i++) {
+            op = od->router_ports[i];
+            if (!op->lsp_addrs || !op->lsp_addrs->n_ipv6_addrs) {
+                continue;
+            }
+            ds_put_format(&actions, "outport = %s; output; ", op->json_key);
+        }
+        if (actions.length != 0) {
+            ds_chomp(&actions, ' ');
+            ovn_lflow_add(lflows, od, S_SWITCH_IN_L2_LKUP, 110, "nd_rs",
+                          ds_cstr(&actions));
+        }
+    }
+
     /* Ingress table 13: Destination lookup, broadcast and multicast handling
      * (priority 100). */
     HMAP_FOR_EACH (op, key_node, ports) {
-- 
2.7.4




More information about the dev mailing list