X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ofproto%2Fin-band.c;h=884cf1d26fb70e411803dc3b124c777e292d9325;hb=5b3941ee1797172ee1f349d6a03e3914217ce890;hp=bf90273e132e4243ada5f0fbef1ff3fd2f8590a1;hpb=d2ede7bc13478e45c58d31a3fe569785b0622682;p=openvswitch diff --git a/ofproto/in-band.c b/ofproto/in-band.c index bf90273e..884cf1d2 100644 --- a/ofproto/in-band.c +++ b/ofproto/in-band.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -745,14 +746,9 @@ in_band_run(struct in_band *ib) void in_band_wait(struct in_band *in_band) { - time_t now = time_now(); - time_t wakeup + long long int wakeup = MIN(in_band->next_remote_refresh, in_band->next_local_refresh); - if (wakeup > now) { - poll_timer_wait((wakeup - now) * 1000); - } else { - poll_immediate_wake(); - } + poll_timer_wait_until(wakeup * 1000); } /* ofproto has flushed all flows from the flow table and it is calling us back