summaryrefslogtreecommitdiff
path: root/sysdep/linux/netlink.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2023-01-22 13:19:22 +0100
committerMaria Matejka <mq@ucw.cz>2023-01-22 13:19:22 +0100
commit521fec2fdc391ee468fd3f58f994609483e6a6eb (patch)
treecf78b05da718c8003332e25b0217f3769f964aaf /sysdep/linux/netlink.c
parent21c4c8eafb7125375b2e562cc0e7e9d52bbb1aaf (diff)
parent2b7643e1f8ecb0bd4cf9af4183b4fd53b655d19c (diff)
Merge commit '2b7643e1f8ecb0bd4cf9af4183b4fd53b655d19c' into thread-next
Diffstat (limited to 'sysdep/linux/netlink.c')
-rw-r--r--sysdep/linux/netlink.c53
1 files changed, 2 insertions, 51 deletions
diff --git a/sysdep/linux/netlink.c b/sysdep/linux/netlink.c
index 288261f5..0609fde8 100644
--- a/sysdep/linux/netlink.c
+++ b/sysdep/linux/netlink.c
@@ -28,56 +28,7 @@
#include "lib/macro.h"
#include "conf/conf.h"
-#ifdef CONFIG_LINUX_NETLINK
-#include <asm/types.h>
-#include <linux/if.h>
-#include <linux/netlink.h>
-#include <linux/rtnetlink.h>
-#endif
-#ifdef CONFIG_FREEBSD_NETLINK
-#include <netlink/netlink.h>
-#include <netlink/netlink_route.h>
-#endif
-
-#ifdef HAVE_MPLS_KERNEL
-#include <linux/lwtunnel.h>
-#endif
-
-#ifndef MSG_TRUNC /* Hack: Several versions of glibc miss this one :( */
-#define MSG_TRUNC 0x20
-#endif
-
-#ifndef IFA_FLAGS
-#define IFA_FLAGS 8
-#endif
-
-#ifndef IFF_LOWER_UP
-#define IFF_LOWER_UP 0x10000
-#endif
-
-#ifndef RTA_TABLE
-#define RTA_TABLE 15
-#endif
-
-#ifndef RTA_VIA
-#define RTA_VIA 18
-#endif
-
-#ifndef RTA_NEWDST
-#define RTA_NEWDST 19
-#endif
-
-#ifndef RTA_ENCAP_TYPE
-#define RTA_ENCAP_TYPE 21
-#endif
-
-#ifndef RTA_ENCAP
-#define RTA_ENCAP 22
-#endif
-
-#ifndef NETLINK_GET_STRICT_CHK
-#define NETLINK_GET_STRICT_CHK 12
-#endif
+#include CONFIG_INCLUDE_NLSYS_H
#define krt_ipv4(p) ((p)->af == AF_INET)
@@ -416,7 +367,7 @@ nl_error(struct nlmsghdr *h, int ignore_esrch)
return ENOBUFS;
}
e = (struct nlmsgerr *) NLMSG_DATA(h);
- ec = -e->error;
+ ec = netlink_error_to_os(e->error);
if (ec && !(ignore_esrch && (ec == ESRCH)))
log_rl(&rl_netlink_err, L_WARN "Netlink: %s", strerror(ec));
return ec;