@@ -211,6 +211,7 @@ Steffen Gebert
steffen.gebert@informatik.uni-wuerzburg.de
Sten Spans sten@blinkenlights.nl
Stephane A. Sezer sas@cd80.net
Stephen Finucane stephen.finucane@intel.com
+Steve Ruan ruansx@cn.ibm.com
SUGYO Kazushi sugyo.org@gmail.com
Tadaaki Nagao nagao@stratosphere.co.jp
Terry Wilson twilson@redhat.com
@@ -1828,74 +1828,65 @@ add_route(struct hmap *lflows, const struct
ovn_port *op,
static void
build_static_route_flow(struct hmap *lflows, struct ovn_datapath *od,
- struct hmap *ports,
- const struct nbrec_logical_router_static_route *route)
+ struct hmap *ports,
+ const struct nbrec_logical_router_static_route
*route)
{
ovs_be32 prefix, next_hop, mask;
- /* Verify that next hop is an IP address with 32 bits mask */
+ /* Verify that next hop is an IP address with 32 bits mask. */
char *error = ip_parse_masked(route->nexthop, &next_hop, &mask);
if (error || mask != OVS_BE32_MAX) {
- static struct vlog_rate_limit rl
- = VLOG_RATE_LIMIT_INIT(5, 1);
- VLOG_WARN_RL(&rl, "bad next hop ip address %s",
- route->nexthop);
+ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 1);
+ VLOG_WARN_RL(&rl, "bad next hop ip address %s", route->nexthop);
free(error);
return;
}
- /* Verify that ip prefix is a valid CIDR address */
+ /* Verify that ip prefix is a valid CIDR address. */
error = ip_parse_masked(route->ip_prefix, &prefix, &mask);
if (error || !ip_is_cidr(mask)) {
- static struct vlog_rate_limit rl
- = VLOG_RATE_LIMIT_INIT(5, 1);
+ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 1);
VLOG_WARN_RL(&rl, "bad 'network' in static routes %s",
- route->ip_prefix);
+ route->ip_prefix);
free(error);
return;
}
- /* Find the outgoing port */
+ /* Find the outgoing port. */
struct ovn_port *out_port = NULL;
if (route->output_port) {
out_port = ovn_port_find(ports, route->output_port);
if (!out_port) {
- static struct vlog_rate_limit rl
- = VLOG_RATE_LIMIT_INIT(5, 1);
+ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 1);
VLOG_WARN_RL(&rl, "Bad out port %s for static route %s",
- route->output_port, route->ip_prefix);
+ route->output_port, route->ip_prefix);
return;
}
} else {
-
- /* output_port is not specified, then find the
- * router port match next hop */
-
+ /* output_port is not specified, find the
+ * router port matching the next hop. */
int i;
for (i = 0; i < od->nbr->n_ports; i++) {
-
struct nbrec_logical_router_port *lrp = od->nbr->ports[i];
out_port = ovn_port_find(ports, lrp->name);
if (!out_port) {
- /* This should not happen */
+ /* This should not happen. */
continue;
}
if (out_port->network
&& !((out_port->network ^ next_hop) & out_port->mask)) {
- /* There should have ONLY 1 interface match the next hop,
- * or it's a configuration error, because subnets of
router's
- * interfaces should NOT be overlapped */
+ /* There should be only 1 interface that matches the next
hop.
+ * Otherwise, it's a configuration error, because subnets
of
+ * router's interfaces should NOT overlap. */
break;
break;
}
}
if (i == od->nbr->n_ports) {
-
- /* There is no matched out port */
- static struct vlog_rate_limit rl
- = VLOG_RATE_LIMIT_INIT(5, 1);
+ /* There is no matched out port. */
+ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 1);
VLOG_WARN_RL(&rl, "No path for static route %s; next hop %s",
- route->ip_prefix, route->nexthop);
+ route->ip_prefix, route->nexthop);
return;
}
}
@@ -2072,7 +2063,7 @@ build_lrouter_flows(struct hmap *datapaths, struct
hmap *ports,
continue;
}
- /* convert the routing table to flow */
+ /* Convert the static routes to flows. */
for (int i = 0; i < od->nbr->n_static_routes; i++) {
const struct nbrec_logical_router_static_route *route;
@@ -624,7 +624,7 @@
</column>
<column name="static_routes">
- One or more static routes, refer to Logical_Router_Static_Route
table.
+ One or more static routes for the router.
</column>