+ /* Prevent overflow due to rounding errors */
+ if (quota_in > UINT32_MAX)
+ quota_in = UINT32_MAX;
+ if (quota_out > UINT32_MAX)
+ quota_out = UINT32_MAX;
+
+ /* Compare to current bandwidth assigned */
+ if ((quota_in != ntohl(cur->addr->assigned_bw_in.value__)) ||
+ (quota_out != ntohl(cur->addr->assigned_bw_out.value__)))
+ {
+ cur->addr->assigned_bw_in.value__ = htonl (quota_in);
+ cur->addr->assigned_bw_out.value__ = htonl (quota_out);
+ /* Notify on change */
+ if ((GNUNET_YES == cur->addr->active) && (cur->addr != address_except))
+ s->bw_changed (s->bw_changed_cls, cur->addr);
+ }