diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2014-08-14 18:30:56 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2014-08-14 18:38:51 +0200 |
commit | 6f7131bae7f31ebc39c1e6a044c46b18d7267a30 (patch) | |
tree | d91d540ad7e813ed8e069bc770dc77e14870d835 /ring.h | |
parent | d1eef162252faf60b2acb19a1df70c1a5e13ecd2 (diff) |
netsniff-ng: Protect all access to tpacket v3 structs and constants (this time for real)
Commit 0fab564a98d1 ("netsniff-ng: Properly wrap usage of all tpacket v3
structs") took care of protecting _some_ tpacket v3 structures with
compile error when building with !HAVE_TPACKET3 (reported by Mike
Reeves):
> CC ring_rx.c
> ring_rx.c: In function 'setup_rx_ring_layout':
> ring_rx.c:124: warning: implicit declaration of function 'set_sockopt_tpacket_v3'
> ring_rx.c: In function 'sock_rx_net_stats':
> ring_rx.c:194: error: field 'k3' has incomplete type
> make: *** [netsniff-ng/ring_rx.o] Error 1
Many thanks to Mike for helping me sort out these problems.
Reported-by: Mike Reeves <luke@geekempire.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'ring.h')
-rw-r--r-- | ring.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -145,6 +145,10 @@ static inline void set_sockopt_tpacket_v3(int sock) { __set_sockopt_tpacket(sock, TPACKET_V3); } +#else +static inline void set_sockopt_tpacket_v3(int sock __maybe_unused) +{ +} #endif static inline int get_sockopt_tpacket(int sock) |