X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Frconn.c;h=6bd43940eebc174bc764a1825656953016ad9586;hb=c69ee87c10818267f991236201150b1fa51ae519;hp=771b3a30400812ccfeb9c23217be0c5332cf86b2;hpb=67a4917b07031b387beafaedce413b4207214059;p=sliver-openvswitch.git diff --git a/lib/rconn.c b/lib/rconn.c index 771b3a304..6bd43940e 100644 --- a/lib/rconn.c +++ b/lib/rconn.c @@ -176,7 +176,7 @@ rconn_new_from_vconn(const char *name, struct vconn *vconn) struct rconn * rconn_create(int probe_interval, int max_backoff) { - struct rconn *rc = xcalloc(1, sizeof *rc); + struct rconn *rc = xzalloc(sizeof *rc); rc->state = S_VOID; rc->state_entered = time_now(); @@ -459,6 +459,15 @@ void rconn_run(struct rconn *rc) { int old_state; + size_t i; + + if (rc->vconn) { + vconn_run(rc->vconn); + } + for (i = 0; i < rc->n_monitors; i++) { + vconn_run(rc->monitors[i]); + } + do { old_state = rc->state; switch (rc->state) { @@ -476,7 +485,17 @@ rconn_run(struct rconn *rc) void rconn_run_wait(struct rconn *rc) { - unsigned int timeo = timeout(rc); + unsigned int timeo; + size_t i; + + if (rc->vconn) { + vconn_run_wait(rc->vconn); + } + for (i = 0; i < rc->n_monitors; i++) { + vconn_run_wait(rc->monitors[i]); + } + + timeo = timeout(rc); if (timeo != UINT_MAX) { unsigned int expires = sat_add(rc->state_entered, timeo); unsigned int remaining = sat_sub(expires, time_now());