bridge: Properly test for out-of-range values.
authorBen Pfaff <blp@nicira.com>
Fri, 15 Apr 2011 16:40:50 +0000 (09:40 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 18 Apr 2011 17:32:50 +0000 (10:32 -0700)
commitb5a253896346849fdf515d0ed57fd3a2a9539753
treec2c128b9dece464cb54678faba7c31a295185012
parent5160ab34f8e97de8985d75d77c029324e4bccdab
bridge: Properly test for out-of-range values.

This code was trying to check for priorities greater than UINT16_MAX and
reset them, but it assigned the value to a uint16_t before it checked it,
which of course hid the problem.

Fixes the following GCC warning:

vswitchd/bridge.c:3034: warning: comparison is always false due to limited
range of data type

Reported-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
vswitchd/bridge.c