summaryrefslogtreecommitdiff
path: root/sysdep/linux
diff options
context:
space:
mode:
authorLuiz Amaral <email@luiz.eng.br>2023-06-15 15:01:50 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2023-06-15 16:07:36 +0200
commitf8bcb037b5b71a19209f1b63d52895c8c34c675b (patch)
tree655956d440ae6feacc49ad9eb8f3b76f828b1f4d /sysdep/linux
parent90f417604518cbaa6f5b8a833352d73c51e53e57 (diff)
Netlink: Allow RTA_VIA even without MPLS support
It is necessary for IPv4 over IPv6 nexthop support on FreeBSD, and RTA_VIA is not really related to MPLS. It breaks build for some very old systems like Debian 8 and CentOS 7, but we generally do not support older kernels than 4.14 LTS anyway.
Diffstat (limited to 'sysdep/linux')
-rw-r--r--sysdep/linux/netlink.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/sysdep/linux/netlink.c b/sysdep/linux/netlink.c
index 7f0d4736..e3298a0f 100644
--- a/sysdep/linux/netlink.c
+++ b/sysdep/linux/netlink.c
@@ -485,7 +485,6 @@ static inline ip_addr rta_get_ipa(struct rtattr *a)
return ipa_from_ip6(rta_get_ip6(a));
}
-#ifdef HAVE_MPLS_KERNEL
static inline ip_addr rta_get_via(struct rtattr *a)
{
struct rtvia *v = RTA_DATA(a);
@@ -496,6 +495,7 @@ static inline ip_addr rta_get_via(struct rtattr *a)
return IPA_NONE;
}
+#ifdef HAVE_MPLS_KERNEL
static u32 rta_mpls_stack[MPLS_MAX_LABEL_STACK];
static inline int rta_get_mpls(struct rtattr *a, u32 *stack)
{
@@ -763,10 +763,8 @@ nl_parse_multipath(struct nl_parse_state *s, struct krt_proto *p, const net_addr
if (a[RTA_FLOW])
s->rta_flow = rta_get_u32(a[RTA_FLOW]);
-#ifdef HAVE_MPLS_KERNEL
if (a[RTA_VIA])
rv->gw = rta_get_via(a[RTA_VIA]);
-#endif
if (nh->rtnh_flags & RTNH_F_ONLINK)
rv->flags |= RNF_ONLINK;
@@ -1659,10 +1657,8 @@ nl_parse_route(struct nl_parse_state *s, struct nlmsghdr *h)
if (a[RTA_GATEWAY])
ra->nh.gw = rta_get_ipa(a[RTA_GATEWAY]);
-#ifdef HAVE_MPLS_KERNEL
if (a[RTA_VIA])
ra->nh.gw = rta_get_via(a[RTA_VIA]);
-#endif
if (i->rtm_flags & RTNH_F_ONLINK)
ra->nh.flags |= RNF_ONLINK;