[ofa-general] RE: [PATCH] rdma_cm: fix port type (fix bug 557)
Yosef Eitgin
yosefe at voltaire.com
Mon Jun 4 12:55:09 PDT 2007
>> Even if next_port is initialized to a negative value by get_random_bytes, I
>> would expect next_port to be set to a positive value between local_port_range[0]
>> and local_port_range[1] by the next statement. I'm not seeing the error my my
>> math/logic here.
>
>My my English needs help, but here's the definitions for '%' in C89 and
>C99 according to Wikipedia:
>
>C89 - sign of result is not defined
>C99 - result has same sign as dividend
>
>Could the compiler be causing the difference on this?
>
>- Sean
>
Possible. I was using the OFED build environment in sles10sp1, and without the
patch next_port sometimes gets a negative value. This might be the reason it was
difficult to reproduce this. Anyway, in order to cover all possibilities (such
as C99), I think that next_port should be unsigned.
--Yossi
More information about the general
mailing list