[PATCH 1/7] Babel: Make sure intervals don't overflow.

Ondrej Zajicek santiago at crfreenet.org
Wed Jul 20 11:39:47 CEST 2016


On Tue, Jul 19, 2016 at 06:09:41PM +0200, Toke Høiland-Jørgensen wrote:
> Ondrej Zajicek <santiago at crfreenet.org> writes:
> 
> > On Mon, May 02, 2016 at 07:07:49PM +0200, Toke Høiland-Jørgensen wrote:
> >> Intervals are carried as 16-bit centisecond values, but kept internally
> >> in 16-bit second values, which causes a potential for overflow. This
> >> adds some checks to make sure this doesn't happen.
> >> 
> >> +  /* make sure we don't overflow the 16-bit centisec fields */
> >>    if (!BABEL_IFACE->update_interval)
> >> -    BABEL_IFACE->update_interval = BABEL_IFACE->hello_interval*BABEL_UPDATE_INTERVAL_FACTOR;
> >> -  BABEL_IFACE->ihu_interval = BABEL_IFACE->hello_interval*BABEL_IHU_INTERVAL_FACTOR;
> >> +    BABEL_IFACE->update_interval = MIN_(BABEL_IFACE->hello_interval*BABEL_UPDATE_INTERVAL_FACTOR, BABEL_MAX_INTERVAL);
> >> +  BABEL_IFACE->ihu_interval = MIN_(BABEL_IFACE->hello_interval*BABEL_IHU_INTERVAL_FACTOR, BABEL_MAX_INTERVAL);
> >
> > This is not completely correct, because IHU interval is not independent
> > of hello_interval in this implementation - IHUs are sent for each
> > BABEL_IHU_INTERVAL_FACTOR hellos even if ihu_interval is limited by this.
> 
> Yeah, you're right. Hmm, guess it doesn't really make sense to have the
> IHU interval configurable by itself, then?

Probably not. But it makes sense to have configurable IHU factor
(different for wired and wireless networks). And if hello*factor is too
large, then just use smaller factor.

-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santiago at crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."



More information about the Bird-users mailing list