git: net/radix: Fix a subtle type cast error in rn_lexobetter()
Aaron LI
aly at crater.dragonflybsd.org
Fri Nov 10 01:58:14 PST 2023
commit dbab1c92bfbffc81bd766d94c0426a58922865b5
Author: Aaron LI <aly at aaronly.me>
Date: Sat Sep 9 16:39:42 2023 +0800
net/radix: Fix a subtle type cast error in rn_lexobetter()
The char byte comparison should be cast to 'unsigned'; otherwise, the
result is wrong in some special cases, e.g.,
rn_lexobetter(<255.255.0.0>, <255.255.128.0>) was giving 'true' while
'false' is expected.
While there, add a brief function description and clean up a bit for
readability.
Summary of changes:
sys/net/radix.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/dbab1c92bfbffc81bd766d94c0426a58922865b5
--
DragonFly BSD source repository
More information about the Commits
mailing list