[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

nsaddr_t - why is it an int32_t?



Hi,

I think nsaddr_t should be a u_int32_t - I've spent most of the afternoon
looking for a problem that wouldn't have arisen if nsaddr_t was a
u_int32_t - essentially, it was a test for mcast in the rsvp/ns code that
worked by comparing the node addr with 1 << McastShift (addr >=
1<<mcastshift) - if the comparison is done using u_int32_t's everything is
ok, but if int32_t's are used, then the result is not the desired result.
It's probably better to use a bitwise and based test which would return
the correct result in any case but I still think it more natural for
nsaddr_t to be u_int32_t's.

Is there a reason why nsaddr_t's should be int32_t's? Are there situations
in which negative node numbers are used?

Sean.

-----
Sean Murphy,			Email: [email protected]
Teltec Ireland,			Phone: +353-1-7045080
DCU, Dublin 9,			Fax:   +353-1-7045092
Ireland.