netdev-bsd: Fix sign extension bug in ifr_flags on FreeBSD.
authorKevin Lo <kevlo@FreeBSD.org>
Sat, 4 Apr 2015 16:59:26 +0000 (00:59 +0800)
committerBen Pfaff <blp@nicira.com>
Sun, 5 Apr 2015 16:58:25 +0000 (09:58 -0700)
commitad5c52ec548c8ee2ace4afe8fd14d7d437485433
tree49514d906659037c962cbec951e881f76fe03fbb
parentcbcd9601894007db68d4df20c2a1fbd6421f8c38
netdev-bsd: Fix sign extension bug in ifr_flags on FreeBSD.

FreeBSD fills the int return value with ifr_flagshigh in the high
16 bits and ifr_flags in the low 16 bits rather than blindly promoting
ifr_flags to an int, which will preserve the sign.
This commit makes sure the flags returned isn't negative and apply mask
0xffff to flags.

Signed-off-by: Kevin Lo <kevlo@FreeBSD.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/netdev-bsd.c