If an agent address is not provided, OVS tries to choose a source address based on the source IP that would be used to connect to the sFlow collector. The code previously set the agent address to the collector's address instead of using the calculated source address. This patch properly uses the source address.
Reported-by: Neil McKee <[email protected]> Signed-off-by: Justin Pettit <[email protected]> --- ofproto/ofproto-dpif-sflow.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ofproto/ofproto-dpif-sflow.c b/ofproto/ofproto-dpif-sflow.c index d17d7a8be83c..62a09b5d1b1e 100644 --- a/ofproto/ofproto-dpif-sflow.c +++ b/ofproto/ofproto-dpif-sflow.c @@ -472,11 +472,12 @@ sflow_choose_agent_address(const char *agent_device, /* sFlow only supports target in default routing table with * packet mark zero. */ - ip = ss_get_address(&ss); + struct in6_addr target_ip = ss_get_address(&ss); struct in6_addr gw, src = in6addr_any; char name[IFNAMSIZ]; - if (ovs_router_lookup(0, &ip, name, &src, &gw)) { + if (ovs_router_lookup(0, &target_ip, name, &src, &gw)) { + ip = src; goto success; } } -- 2.17.1 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
