diff options
author | Florin Coras <fcoras@cisco.com> | 2021-11-22 21:34:56 -0800 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2021-11-23 10:03:59 +0000 |
commit | 2dc942e8735de7e4e6bb7212e2c006190d5dcc52 (patch) | |
tree | 5a40f724810e9608dbec141a5c2716ca14c8473c /src/vnet/devices/af_packet/af_packet.c | |
parent | fa1fb608b6092fd057b993cfd779bd9ee8306974 (diff) |
devices: support build on older kernels
Type: improvement
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I10af028b5e57b36b8015b02240f1e4e9a42d0898
Diffstat (limited to 'src/vnet/devices/af_packet/af_packet.c')
-rw-r--r-- | src/vnet/devices/af_packet/af_packet.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vnet/devices/af_packet/af_packet.c b/src/vnet/devices/af_packet/af_packet.c index 0508d3ec963..bfa28031c1c 100644 --- a/src/vnet/devices/af_packet/af_packet.c +++ b/src/vnet/devices/af_packet/af_packet.c @@ -189,6 +189,8 @@ create_packet_v2_sock (int host_if_index, tpacket_req_t * rx_req, goto error; } +#if defined(PACKET_QDISC_BYPASS) + /* Introduced with Linux 3.14 so the ifdef should eventually be removed */ if (setsockopt (*fd, SOL_PACKET, PACKET_QDISC_BYPASS, &opt, sizeof (opt)) < 0) { @@ -197,6 +199,7 @@ create_packet_v2_sock (int host_if_index, tpacket_req_t * rx_req, "handling option: %s (errno %d)", strerror (errno), errno); } +#endif if (setsockopt (*fd, SOL_PACKET, PACKET_RX_RING, rx_req, req_sz) < 0) { |