Issue with unsigned integer LOCAL_PREF
Ondrej Zajicek
santiago at crfreenet.org
Tue Dec 1 17:51:02 CET 2020
On Wed, Nov 25, 2020 at 11:43:29AM +0100, Alexandre Corso wrote:
> Hello Bird team,
>
> Thank you for the great tool BIRD. I would like to open an issue (bird v2.0.7) about the local_pref.
>
> ...
>
> We had an exception to check the value of local_pref (on the filter)
> but can we have the something on the code, not to overflow the
> local_pref, for example SET to 0 if the value overflow?
Hello
There are at least three reasonable behaviors for fixed-range
arithmetics:
1) silent overflow (current behavior)
2) silent saturation (as you suggested)
3) explicit (logged) error
Not really sure which is better. (1) is likely least astonishment (for
fixed-range), (2) is most useful when overflows are intentional, (3) is
most useful when overflows are unintentional.
I have minor preference for (3), but no strong preference either way to
change anything. Also note that in cases when fixed-range attributes have
lower range than 32bits (i.e. 16bit preference and 24bit ospf_metrics),
we generate explicit error on overflow on assignment.
Or perhaps we should just move to arbitrary-range integers .. many new
RFCs already use 64bit attributes anyways.
--
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