summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ring.h21
1 files changed, 8 insertions, 13 deletions
diff --git a/ring.h b/ring.h
index cb09d99..55d5e96 100644
--- a/ring.h
+++ b/ring.h
@@ -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);