net: work around s_addr macro on Windows
authorDmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Sat, 10 Apr 2021 22:47:31 +0000 (01:47 +0300)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 14 Apr 2021 23:56:40 +0000 (01:56 +0200)
commit6c068dbd9fea4dc12f96101b86758a6170aa2d64
treeef45aa294507c911754e64bef4349fce81419b4b
parent45d62067c23746f9fd4eafc26099d8df859f318a
net: work around s_addr macro on Windows

Windows Sockets headers contain `#define s_addr S_un.S_addr`, which
conflicts with definition of `s_addr` field of `struct rte_ether_hdr`.
Prieviously `s_addr` was undefined in <rte_ether.h>, which had been
breaking access to `s_addr` field of `struct in_addr`, so some DPDK
and Windows headers could not be included in one file.

Renaming of `struct rte_ether_hdr` is planned:
https://mails.dpdk.org/archives/dev/2021-March/201444.html

Temporarily disable `s_addr` macro around `struct rte_ether_hdr`
definition to avoid conflict. Place source MAC address in both `s_addr`
and `S_un.S_addr` fields, so that access works either directly or
through the macro as defined in Windows headers.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Ranjit Menon <ranjit.menon@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
lib/librte_net/rte_ether.h