diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2014-02-24 14:55:53 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2014-02-24 14:55:53 +0100 |
commit | 4206469f7028ca9a14a4bd8141b51dd444e979a6 (patch) | |
tree | 403e7ac4c8c221867cdb0bd263f9248e203c0392 /ring.h | |
parent | 11c34c86ca4a0a355276d675eb46ae084ab7f7e8 (diff) |
ring: Get rid of unnecessary wrapper for get_sockopt_tpacket
get_sockopt_tpacket is never used in the "raw" version and the wrapper
does no additional checking anyway, so get rid of it.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'ring.h')
-rw-r--r-- | ring.h | 21 |
1 files changed, 8 insertions, 13 deletions
@@ -128,18 +128,6 @@ static inline void __set_sockopt_tpacket(int sock, int val) panic("Cannot set tpacketv2!\n"); } -static inline int __get_sockopt_tpacket(int sock) -{ - int val, ret; - socklen_t len = sizeof(val); - - ret = getsockopt(sock, SOL_PACKET, PACKET_VERSION, &val, &len); - if (ret) - panic("Cannot get tpacket version!\n"); - - return val; -} - static inline void set_sockopt_tpacket_v2(int sock) { __set_sockopt_tpacket(sock, TPACKET_V2); @@ -154,7 +142,14 @@ static inline void set_sockopt_tpacket_v3(int sock) static inline int get_sockopt_tpacket(int sock) { - return __get_sockopt_tpacket(sock); + int val, ret; + socklen_t len = sizeof(val); + + ret = getsockopt(sock, SOL_PACKET, PACKET_VERSION, &val, &len); + if (ret) + panic("Cannot get tpacket version!\n"); + + return val; } extern void mmap_ring_generic(int sock, struct ring *ring); |