iproute2/bridge
Andreas Henriksson 9dca899b2d bridge: Make filter_index match in signedness
Michael Tautschnig wrote:

During a rebuild [...]. Please note that we use our research
compiler tool-chain (using tools from the cbmc package), which permits extended
reporting on type inconsistencies at link time.

[...]
gcc   bridge.o fdb.o monitor.o link.o mdb.o vlan.o ../lib/libnetlink.a ../lib/libutil.a  ../lib/libnetlink.a ../lib/libutil.a -o bridge
file link.c line 18: error: conflicting types for variable "filter_index"
old definition in module fdb file fdb.c line 29
signed int
new definition in module link file link.c line 18
unsigned int
<builtin>: recipe for target 'bridge' failed
make[3]: *** [bridge] Error 64
make[3]: Leaving directory '/srv/jenkins-slave/workspace/sid-goto-cc-iproute2/iproute2-3.14.0/bridge'
Makefile:45: recipe for target 'all' failed

While practical constraints may limit the value of filter_index to remain within
the bounds of a positive signed int, there is certainly no such guarantee here.
Also, a plain majority vote suggests that this really just a wrong declaration
in link.c as several declarations of filter_index as signed int exist.

[...]

My followup on this was:

I think the majority is wrong.

filter_index is assigned exclusively from if_nametoindex or ll_name_to_index
which both return unsigned int.

Changing it to unsigned everywhere seems better.

This has been minimally tested by using the bridge tool
to add vids and showing available vids on different devices.

Reported-by: Michael Tautschnig <mt@debian.org>
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2014-06-09 12:40:45 -07:00
..
.gitignore Add bridge command 2012-08-01 15:23:49 -07:00
Makefile bridge: Add vlan configuration support 2013-03-06 11:03:08 -08:00
br_common.h bridge: Add support for setting bridge port attributes 2013-03-16 10:01:53 -07:00
bridge.c bridge: add oneline option 2013-03-16 10:18:50 -07:00
fdb.c bridge: Make filter_index match in signedness 2014-06-09 12:40:45 -07:00
link.c bridge: Make filter_index match in signedness 2014-06-09 12:40:45 -07:00
mdb.c bridge: Make filter_index match in signedness 2014-06-09 12:40:45 -07:00
monitor.c iproute2: bridge: Close file with bridge monitor file 2013-09-30 21:00:06 -07:00
vlan.c bridge: Make filter_index match in signedness 2014-06-09 12:40:45 -07:00