From: Michal Sojka Date: Mon, 10 Aug 2009 14:46:58 +0000 (+0200) Subject: Reject contracts with zero period and budget X-Git-Url: http://rtime.felk.cvut.cz/gitweb/frescor/fwp.git/commitdiff_plain/35e155049f6529e113bd7fa6a4b95c0236c67718 Reject contracts with zero period and budget --- diff --git a/fwp/mngr/fwp_admctrl.c b/fwp/mngr/fwp_admctrl.c index 62ee83f..f51e06d 100644 --- a/fwp/mngr/fwp_admctrl.c +++ b/fwp/mngr/fwp_admctrl.c @@ -175,10 +175,12 @@ int fwp_admctrl_utilization(struct fres_sa_scenario *scenario, void *priv, fosa_rel_time_to_msec(basic->period), (long unsigned int)bytes); + period_usec = basic ? fosa_rel_time_to_msec(basic->period)*1000 : 0; + /* Calculate protocol overhead */ fragments = (bytes + MTU - 1) / MTU; - if (fragments == 0) + if (fragments == 0 && period_usec != 0) continue; const int data_overhead = UDP_HEADER_SIZE + IP_HEADER_SIZE + @@ -202,9 +204,6 @@ int fwp_admctrl_utilization(struct fres_sa_scenario *scenario, void *priv, * AP may use different values for backoff. */ //duration_usec *= 2; /* For demo, we have always STA-to-STA */ - basic = fres_contract_get_basic(c->contract); - period_usec = basic ? fosa_rel_time_to_msec(basic->period)*1000 : 0; - if (c->contract == c->new) { if (period_usec == 0) { ul_logmsg("Period is zero!\n");