Skip to contentSkip to conversation

iproute: change to if_bridge.h breaks build

REGRESSION Stephen Hemminger 1 participant 1 message Dec 10, 2014

Subsystems (2)
lore
Share & tools
lore

Stephen Hemminger

author Acked-by Cong Wang
#0 lore raw

This commit causes build problems in iproute.

I can fix it for iproute, by reordering the headers but on the principle that updates should never break builds of existing code, this is wrong.

gcc -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wformat=2 -O2 -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib\" -DCONFDIR=\"/etc/iproute2\" -D_GNU_SOURCE -DHAVE_SETNS -c -o iplink_bridge_slave.o iplink_bridge_slave.c
In file included from ../include/linux/if_bridge.h:18:0,
from iplink_bridge_slave.c:16:
../include/linux/in6.h:169:0: warning: "IPV6_ADD_MEMBERSHIP" redefined
#define IPV6_ADD_MEMBERSHIP 20
^
In file included from /usr/include/netinet/in.h:37:0,
from iplink_bridge_slave.c:14:
commit 66f1c44887ba4f47d617f8ae21cf8e04e1892bd7

Author: Gregory Fong <[email protected]>
Date:   Tue Nov 4 11:21:21 2014 -0800

bridge: include in6.h in if_bridge.h for struct in6_addr

if_bridge.h uses struct in6_addr ip6, but wasn't including the in6.h header. Thomas Backlund originally sent a patch to do this, but this revealed a redefinition issue: https://lkml.org/lkml/2013/1/13/116

The redefinition issue should have been fixed by the following Linux
commits:
ee262ad827f89e2dc7851ec2986953b5b125c6bc inet: defines IPPROTO_* needed for module alias generation cfd280c91253cc28e4919e349fa7a813b63e71e8 net: sync some IP headers with glibc

and the following glibc commit:
6c82a2f8d7c8e21e39237225c819f182ae438db3 Coordinate IPv6 definitions for Linux and glibc

so actually include the header now.