tipc: Fix minor bugs in link session number handling
authorAllan Stephens <allan.stephens@windriver.com>
Thu, 5 Jun 2008 00:29:39 +0000 (17:29 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 5 Jun 2008 00:29:39 +0000 (17:29 -0700)
commita686e6859e976712e28f6af927cd52a6a3bb372a
tree2d1f1092416394e8dba4ffc38eec03c9aedd4ebf
parente0d4e3d0d72cfae7b7eac14e39e12dfc6b406313
tipc: Fix minor bugs in link session number handling

This patch introduces a new, out-of-range value to indicate that
a link endpoint does not have an existing session established
with its peer, eliminating the risk that the previously used
"invalid session number" value (i.e. zero) might eventually be
assigned as a valid session number and cause incorrect link
behavior.

The patch also introduces explicit bit masking when assigning a
new link session number to ensure it does not exceed 16 bits.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/link.c