summaryrefslogtreecommitdiff
path: root/ofproto/ofproto-dpif-sflow.c
diff options
context:
space:
mode:
authorNuman Siddique <nusiddiq@redhat.com>2018-11-02 17:11:01 +0530
committerBen Pfaff <blp@ovn.org>2018-11-05 07:11:10 -0800
commitf31b8ae7a7a777dd9dc40997903a283409674eae (patch)
tree9d9a0286532e426b2d767cc1fc7220aaf8b1d427 /ofproto/ofproto-dpif-sflow.c
parentdf514c62b6685bda925afab6b5857b2067517354 (diff)
downloadopenvswitch-f31b8ae7a7a777dd9dc40997903a283409674eae.tar.gz
ovn-nbctl: Fix the ovn-nbctl test "LBs - daemon" which fails during rpm build
When 'make check' is called by the mock rpm build (which disables networking), the test "ovn-nbctl: LBs - daemon" fails when it runs the command "ovn-nbctl lb-add lb0 30.0.0.1a 192.168.10.10:80,192.168.10.20:80". ovn-nbctl extracts the vip by calling the socket util function 'inet_parse_active()', and this function blocks when libunbound function ub_resolve() is called further down. ub_resolve() is a blocking function without timeout and all the ovs/ovn utilities use this function. As reported by Timothy Redaelli, the issue can also be reproduced by running the below commands $ sudo unshare -mn -- sh -c 'ip addr add dev lo 127.0.0.1 && \ mount --bind /dev/null /etc/resolv.conf && runuser $SUDO_USER' $ make sandbox SANDBOXFLAGS="--ovn" $ ovn-nbctl -vsocket_util:off lb-add lb0 30.0.0.1a \ 192.168.10.10:80,192.168.10.20:80 To address this issue, this patch adds a new bool argument 'resolve_host' to the function inet_parse_active() to resolve the host only if it is 'true'. ovn-nbctl/ovn-northd will pass 'false' when it calls this function to parse the load balancer values. Reported-by: Timothy Redaelli <tredaelli@redhat.com> Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1641672 Signed-off-by: Numan Siddique <nusiddiq@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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ofproto/ofproto-dpif-sflow.c b/ofproto/ofproto-dpif-sflow.c
index 62a09b5d1..7da31753c 100644
--- a/ofproto/ofproto-dpif-sflow.c
+++ b/ofproto/ofproto-dpif-sflow.c
@@ -468,7 +468,7 @@ sflow_choose_agent_address(const char *agent_device,
const char *target;
SSET_FOR_EACH (target, targets) {
struct sockaddr_storage ss;
- if (inet_parse_active(target, SFL_DEFAULT_COLLECTOR_PORT, &ss)) {
+ if (inet_parse_active(target, SFL_DEFAULT_COLLECTOR_PORT, &ss, true)) {
/* sFlow only supports target in default routing table with
* packet mark zero.
*/