netdev-linux: Fix build break on RHEL 6.1.
authorBen Pfaff <blp@nicira.com>
Fri, 17 Jan 2014 01:21:55 +0000 (17:21 -0800)
committerBen Pfaff <blp@nicira.com>
Fri, 17 Jan 2014 07:40:43 +0000 (23:40 -0800)
commit55bc98d6cb340626eab68fa91eeffafe5e5a2339
tree361c78520f1c522e08549dd605257406213d6c56
parentddd43de9ba729023dbee897a330727dfa9a6a7a6
netdev-linux: Fix build break on RHEL 6.1.

Commit 73c85181d (netdev-linux: Read packet auxdata to obtain vlan_tid)
added #include <linux/if_packet.h> to this file, to get the definition
of PACKET_AUXDATA and some other definitions, but on RHEL 6.1 this
provoked compiler errors:

In file included from /usr/include/linux/rtnetlink.h:5,
    from lib/netdev-linux.c:34:
/usr/include/linux/netlink.h:34: error: expected specifier-qualifier-list
    before 'sa_family_t'

Since the old #includes worked everywhere, and this file already defined
its own versions of most of the new macros that it needed, this commit just
reverts the old #includes and adds the one macro definition it didn't
already have.

(RHEL 6.1 isn't necessarily the only platform where this is a problem, but
it's the first one for which we noticed the problem.)

This switches the definition of sockaddr_ll used from the Linux one, which
uses __be16 for sll_protocol, to the glibc one, which uses plain "unsigned
short int".  This makes sparse complain (rightly), so this commit also
adds a sparse-specific header that uses ovs_be16 to prevent the warning.

Signed-off-by: Ben Pfaff <blp@nicira.com>
include/sparse/automake.mk
include/sparse/netpacket/packet.h [new file with mode: 0644]
lib/netdev-linux.c