forked from openvswitch/ovs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sparse: Configure target operating system and fix fallout.
cgcc, the "sparse" wrapper that OVS uses, can be told the host architecture or the host OS or both. Until now, OVS has told it the host architecture because it is fairly common that it doesn't guess it automatically. Until now, OS has not told it the host OS, assuming that it would get it right. However, it doesn't--if you tell it the host OS or the host architecture, it doesn't really have a default for the other. This means that on Linux (presumably the only OS where sparse works properly for OVS), it was not defining __linux__, which caused some weird behavior. This commit adds a flag to the cgcc invocation to make it define __linux__ on Linux, and it fixes some errors that this would otherwise cause. Acked-by: Ilya Maximets <[email protected]> Signed-off-by: Ben Pfaff <[email protected]>
- Loading branch information
Showing
4 changed files
with
36 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#ifndef FIX_LINUX_IF_PACKET_H | ||
#define FIX_LINUX_IF_PACKET_H | ||
|
||
#ifndef __CHECKER__ | ||
#error "Use this header only with sparse. It is not a correct implementation." | ||
#endif | ||
|
||
#include_next <linux/if_packet.h> | ||
|
||
/* Fix endianness of 'spkt_protocol' and 'sll_protocol' members. */ | ||
|
||
#define sockaddr_pkt rpl_sockaddr_pkt | ||
struct sockaddr_pkt { | ||
unsigned short spkt_family; | ||
unsigned char spkt_device[14]; | ||
ovs_be16 spkt_protocol; | ||
}; | ||
|
||
#define sockaddr_ll rpl_sockaddr_ll | ||
struct sockaddr_ll { | ||
unsigned short sll_family; | ||
ovs_be16 sll_protocol; | ||
int sll_ifindex; | ||
unsigned short sll_hatype; | ||
unsigned char sll_pkttype; | ||
unsigned char sll_halen; | ||
unsigned char sll_addr[8]; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters