[ovs-dev] [PATCH] Fix userspace tunnel port with remote_ip is flow not work , where set vxlan port remote_ip is flow then the ovs-appctl tnl\ports\show ipv4 src is 0.0.0.0, tnl_port_map_lookup cann't find the tunnle port with a none zero outer src ip(as 192.168.1.10), so we should change the flow nw_src to zero and try again.
yinpeijun
yinpeijun at huawei.com
Thu Apr 23 11:48:32 UTC 2015
Signed-off-by: yinpeijun <yinpeijun at huawei.com>
---
ofproto/ofproto-dpif-xlate.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index f737877..396d261 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -2749,6 +2749,7 @@ compose_output_action__(struct xlate_ctx *ctx, ofp_port_t ofp_port,
struct flow *flow = &ctx->xin->flow;
struct flow_tnl flow_tnl;
ovs_be16 flow_vlan_tci;
+ ovs_be32 tnl_nw_src;
uint32_t flow_pkt_mark;
uint8_t flow_nw_tos;
odp_port_t out_port, odp_port;
@@ -2985,6 +2986,17 @@ compose_output_action__(struct xlate_ctx *ctx, ofp_port_t ofp_port,
ovs_native_tunneling_is_on(ctx->xbridge->ofproto)) {
odp_tnl_port = tnl_port_map_lookup(flow, wc);
+ /*when 'remote_ip=flow' the tnl port show listening ports
+ *ip_src is 0.0.0.0 , so we should try again with nw_src
+ *zero. */
+ if(odp_tnl_port == ODPP_NONE) {
+ tnl_nw_src = flow->nw_src;
+
+ flow->nw_src = htonl(0);
+ odp_tnl_port = tnl_port_map_lookup(flow, wc);
+
+ flow->nw_src = tnl_nw_src;
+ }
}
if (odp_tnl_port != ODPP_NONE) {
--
1.9.4.msysgit.0
More information about the dev
mailing list