netsniff-ng: Properly wrap usage of all tpacket v3 structs
commit0fab564a98d1a54bc6b6eeac57f41ce182c38018
authorTobias Klauser <tklauser@distanz.ch>
Thu, 14 Aug 2014 13:40:25 +0000 (14 15:40 +0200)
committerTobias Klauser <tklauser@distanz.ch>
Thu, 14 Aug 2014 13:40:25 +0000 (14 15:40 +0200)
tree050e7fdb581af4b0ce32b4dfbf8ad60a1387aec5
parent9b166a9f769392dd0326a1c41864312bd22df07b
netsniff-ng: Properly wrap usage of all tpacket v3 structs

Mike Reeves reports the following compilation error if tpacket v3 is not
available:

>  CC   ring_rx.c
> ring_rx.c: In function 'alloc_rx_ring_frames':
> ring_rx.c:143: error: 'struct ring' has no member named 'layout3'
> ring_rx.c:144: error: 'struct ring' has no member named 'layout3'
> ring_rx.c: In function 'sock_rx_net_stats':
> ring_rx.c:172: error: field 'k3' has incomplete type
> make: *** [netsniff-ng/ring_rx.o] Error 1

The layout3 member of struct ring is only available for HAVE_TPACKET3.
Thus, wrap all access to it into inline functions defined depending on
wheter HAVE_TPACKET3 is defined.

Reported-by: Mike Reeves <luke@geekempire.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
ring_rx.c