diff options
Diffstat (limited to 'include/sparse')
-rw-r--r-- | include/sparse/automake.mk | 1 | ||||
-rw-r--r-- | include/sparse/linux/if_packet.h | 30 |
2 files changed, 31 insertions, 0 deletions
diff --git a/include/sparse/automake.mk b/include/sparse/automake.mk index 4c7b17783..8d96d0346 100644 --- a/include/sparse/automake.mk +++ b/include/sparse/automake.mk @@ -27,4 +27,5 @@ noinst_HEADERS += \ include/sparse/sys/types.h \ include/sparse/sys/wait.h \ include/sparse/threads.h \ + include/sparse/linux/if_packet.h \ include/sparse/linux/tc_act/tc_pedit.h diff --git a/include/sparse/linux/if_packet.h b/include/sparse/linux/if_packet.h new file mode 100644 index 000000000..5ff6d4730 --- /dev/null +++ b/include/sparse/linux/if_packet.h @@ -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 |