summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zebra/debug_nl.c42
-rw-r--r--zebra/ioctl.c11
-rw-r--r--zebra/rib.h2
-rw-r--r--zebra/zebra_rib.c9
4 files changed, 44 insertions, 20 deletions
diff --git a/zebra/debug_nl.c b/zebra/debug_nl.c
index b7d12bf537..98b3a9ed50 100644
--- a/zebra/debug_nl.c
+++ b/zebra/debug_nl.c
@@ -26,6 +26,7 @@
#include <linux/rtnetlink.h>
#include <net/if_arp.h>
#include <linux/fib_rules.h>
+#include <linux/lwtunnel.h>
#include <stdio.h>
#include <stdint.h>
@@ -1234,6 +1235,42 @@ next_rta:
goto next_rta;
}
+static const char *lwt_type2str(uint16_t type)
+{
+ switch (type) {
+ case LWTUNNEL_ENCAP_NONE:
+ return "NONE";
+ case LWTUNNEL_ENCAP_MPLS:
+ return "MPLS";
+ case LWTUNNEL_ENCAP_IP:
+ return "IPv4";
+ case LWTUNNEL_ENCAP_ILA:
+ return "ILA";
+ case LWTUNNEL_ENCAP_IP6:
+ return "IPv6";
+ case LWTUNNEL_ENCAP_SEG6:
+ return "SEG6";
+ case LWTUNNEL_ENCAP_BPF:
+ return "BPF";
+ case LWTUNNEL_ENCAP_SEG6_LOCAL:
+ return "SEG6_LOCAL";
+ default:
+ return "UNKNOWN";
+ }
+}
+
+static const char *nhg_type2str(uint16_t type)
+{
+ switch (type) {
+ case NEXTHOP_GRP_TYPE_MPATH:
+ return "MULTIPATH";
+ case NEXTHOP_GRP_TYPE_RES:
+ return "RESILIENT MULTIPATH";
+ default:
+ return "UNKNOWN";
+ }
+}
+
static void nlnh_dump(struct nhmsg *nhm, size_t msglen)
{
struct rtattr *rta;
@@ -1275,9 +1312,12 @@ next_rta:
nhgrp[i].weight);
break;
case NHA_ENCAP_TYPE:
+ u16v = *(uint16_t *)RTA_DATA(rta);
+ zlog_debug(" %s", lwt_type2str(u16v));
+ break;
case NHA_GROUP_TYPE:
u16v = *(uint16_t *)RTA_DATA(rta);
- zlog_debug(" %d", u16v);
+ zlog_debug(" %s", nhg_type2str(u16v));
break;
case NHA_BLACKHOLE:
/* NOTHING */
diff --git a/zebra/ioctl.c b/zebra/ioctl.c
index facd8e318d..239763754b 100644
--- a/zebra/ioctl.c
+++ b/zebra/ioctl.c
@@ -48,6 +48,7 @@ void ifreq_set_name(struct ifreq *ifreq, struct interface *ifp)
strlcpy(ifreq->ifr_name, ifp->name, sizeof(ifreq->ifr_name));
}
+#ifndef HAVE_NETLINK
/* call ioctl system call */
int if_ioctl(unsigned long request, caddr_t buffer)
{
@@ -73,6 +74,7 @@ int if_ioctl(unsigned long request, caddr_t buffer)
}
return 0;
}
+#endif
/* call ioctl system call */
int vrf_if_ioctl(unsigned long request, caddr_t buffer, vrf_id_t vrf_id)
@@ -127,7 +129,6 @@ static int if_ioctl_ipv6(unsigned long request, caddr_t buffer)
}
return 0;
}
-#endif /* ! HAVE_NETLINK */
/*
* get interface metric
@@ -174,6 +175,7 @@ void if_get_mtu(struct interface *ifp)
ifp->mtu6 = ifp->mtu = -1;
#endif
}
+#endif /* ! HAVE_NETLINK */
/*
* Handler for interface address programming via the zebra dplane,
@@ -217,13 +219,6 @@ enum zebra_dplane_result kernel_address_update_ctx(
ZEBRA_DPLANE_REQUEST_SUCCESS : ZEBRA_DPLANE_REQUEST_FAILURE);
}
-#endif /* !HAVE_NETLINK */
-
-#ifdef HAVE_NETLINK
-
-/* TODO -- remove; no use of these apis with netlink any longer */
-
-#else /* ! HAVE_NETLINK */
#ifdef HAVE_STRUCT_IFALIASREQ
/*
diff --git a/zebra/rib.h b/zebra/rib.h
index 281791d1f8..6b41952050 100644
--- a/zebra/rib.h
+++ b/zebra/rib.h
@@ -357,8 +357,6 @@ enum rib_update_event {
RIB_UPDATE_MAX
};
-extern void route_entry_copy_nexthops(struct route_entry *re,
- struct nexthop *nh);
int route_entry_update_nhe(struct route_entry *re,
struct nhg_hash_entry *new_nhghe);
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index e1da92403e..6801280012 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -292,15 +292,6 @@ int zebra_check_addr(const struct prefix *p)
return 1;
}
-/**
- * copy_nexthop - copy a nexthop to the rib structure.
- */
-void route_entry_copy_nexthops(struct route_entry *re, struct nexthop *nh)
-{
- assert(!re->nhe->nhg.nexthop);
- copy_nexthops(&re->nhe->nhg.nexthop, nh, NULL);
-}
-
static void route_entry_attach_ref(struct route_entry *re,
struct nhg_hash_entry *new)
{