In current implementation vswitchd adds Controller in-band rules only if there 
is a route in
kernel routing table that might route traffic to the Controller. But, when 
executing
force-reload-kmod command, network configuration (e.g. assigned IP addresses, 
routes) are flushed
away, hence Controller in-band rules are not added.

This commit fixes this limitation and allows vswitchd to add Controller in-band 
rules
even if there are no routes in the kernel routing table.

Issue: #8625

Signed-off-by: Ansis Atteka <[email protected]>
---
 ofproto/connmgr.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c
index 6432ba6..bbb018e 100644
--- a/ofproto/connmgr.c
+++ b/ofproto/connmgr.c
@@ -587,14 +587,16 @@ update_in_band_remotes(struct connmgr *mgr)
     /* Add all the remotes. */
     HMAP_FOR_EACH (ofconn, hmap_node, &mgr->controllers) {
         struct sockaddr_in *sin = &addrs[n_addrs];
+        const char *target = rconn_get_target(ofconn->rconn);
 
         if (ofconn->band == OFPROTO_OUT_OF_BAND) {
             continue;
         }
 
-        sin->sin_addr.s_addr = rconn_get_remote_ip(ofconn->rconn);
-        if (sin->sin_addr.s_addr) {
-            sin->sin_port = rconn_get_remote_port(ofconn->rconn);
+        if ((!strncmp(target, "tcp:", 4)
+             && inet_parse_active(target + 4, OFP_TCP_PORT, sin)) ||
+            (!strncmp(target, "ssl:", 4)
+             && inet_parse_active(target + 4, OFP_SSL_PORT, sin))) {
             n_addrs++;
         }
     }
-- 
1.7.4.1

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to