summaryrefslogtreecommitdiff
path: root/ofproto/ofproto-dpif-sflow.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2018-03-31 17:12:54 -0700
committerBen Pfaff <blp@ovn.org>2018-04-03 11:10:25 -0700
commit966574598a3cb86a6d799ca3715005763a7c9186 (patch)
tree6e3a118b0173afaee839ec505083c7dd3918b5f2 /ofproto/ofproto-dpif-sflow.c
parentbaee3741fcd3f22bf3ca0f00b2531a717de521fd (diff)
downloadopenvswitch-966574598a3cb86a6d799ca3715005763a7c9186.tar.gz
vswitchd: Allow user to directly specify sFlow agent address.
At least for testing purposes, and perhaps in production, it is useful to be able to fix the agent IP address directly, rather that indirecting it through a device name or the routing table. This commit uses this feature to fix the agent IP address used in the unit tests. This will be particularly useful in an upcoming commit that disables the use of the system routing table in the unit tests, to make the tests' results independent of the host's routes. CC: Neil McKee <neil.mckee@inmon.com> Tested-By: Timothy Redaelli <tredaelli@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ofproto/ofproto-dpif-sflow.c')
-rw-r--r--ofproto/ofproto-dpif-sflow.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ofproto/ofproto-dpif-sflow.c b/ofproto/ofproto-dpif-sflow.c
index 60e1b4e0a..5d8c0e19f 100644
--- a/ofproto/ofproto-dpif-sflow.c
+++ b/ofproto/ofproto-dpif-sflow.c
@@ -453,7 +453,8 @@ sflow_choose_agent_address(const char *agent_device,
agent_addr->type = SFLADDRESSTYPE_IP_V4;
if (agent_device) {
- if (!netdev_get_in4_by_name(agent_device, &in4)) {
+ if (!netdev_get_in4_by_name(agent_device, &in4)
+ || !lookup_ip(agent_device, &in4)) {
goto success;
}
}