From: Raslan Darawsheh Date: Sun, 10 May 2020 12:23:47 +0000 (+0300) Subject: net/tap: fix build for glibc < 2.24 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=53601aefc477ecdfb587ad5dd0bd286ca985c64f;p=dpdk.git net/tap: fix build for glibc < 2.24 When trying to compile with glibc < 2.24 that doesn't support SOL_NETLINK it will cause compilation failure: drivers/net/tap/tap_netlink.c:70:17: error: 'SOL_NETLINK' undeclared (first use in this function) setsockopt(fd, SOL_NETLINK, NETLINK_EXT_ACK, &one, sizeof(one)); The glibc commits adds the SOL_NETLINK support: https://github.com/bminor/glibc/commit/f9b437d5efce93800b51ad2a437c8b1c9 Fixes: 647909bcf34b ("net/tap: use netlink extended ack support") Signed-off-by: Raslan Darawsheh Reviewed-by: Ferruh Yigit --- diff --git a/drivers/net/tap/tap_netlink.c b/drivers/net/tap/tap_netlink.c index b73802b51e..75af3404b0 100644 --- a/drivers/net/tap/tap_netlink.c +++ b/drivers/net/tap/tap_netlink.c @@ -17,6 +17,11 @@ #include "tap_log.h" +/* Compatibility with glibc < 2.24 */ +#ifndef SOL_NETLINK +#define SOL_NETLINK 270 +#endif + /* Must be quite large to support dumping a huge list of QDISC or filters. */ #define BUF_SIZE (32 * 1024) /* Size of the buffer to receive kernel messages */ #define SNDBUF_SIZE 32768 /* Send buffer size for the netlink socket */