diff options
Diffstat (limited to 'router/router/tap_inject_netlink.c')
-rw-r--r-- | router/router/tap_inject_netlink.c | 40 |
1 files changed, 3 insertions, 37 deletions
diff --git a/router/router/tap_inject_netlink.c b/router/router/tap_inject_netlink.c index 3dca013..bd5da49 100644 --- a/router/router/tap_inject_netlink.c +++ b/router/router/tap_inject_netlink.c @@ -14,25 +14,18 @@ * limitations under the License. */ -#include "tap_inject.h" #include <librtnl/netns.h> #include <vlibmemory/api.h> -#include <vnet/ethernet/arp_packet.h> #include <vnet/ip/ip6_neighbor.h> - -#include <vnet/ip/ip.h> #include <vnet/ip/lookup.h> -#ifdef ip6_add_del_route_next_hop -#define FIB_VERSION 1 -#else #include <vnet/fib/fib.h> -#define FIB_VERSION 2 -#endif - +#include <vnet/ethernet/arp.h> #include <arpa/inet.h> #include <linux/mpls.h> #include <vnet/mpls/packet.h> +#include "tap_inject.h" + static void add_del_addr (ns_addr_t * a, int is_del) { @@ -124,37 +117,24 @@ add_del_neigh (ns_neigh_t * n, int is_del) if (n->nd.ndm_state & NUD_REACHABLE) { -#if FIB_VERSION == 1 - vnet_arp_set_ip4_over_ethernet (vnet_main, sw_if_index, ~0, &a, 0); -#else vnet_arp_set_ip4_over_ethernet (vnet_main, sw_if_index, &a, 0 /* static */ , 0 /* no fib entry */); -#endif /* FIB_VERSION == 1 */ } else if (n->nd.ndm_state & NUD_FAILED) { -#if FIB_VERSION == 1 - vnet_arp_unset_ip4_over_ethernet (vnet_main, sw_if_index, ~0, &a); -#else vnet_arp_unset_ip4_over_ethernet (vnet_main, sw_if_index, &a); -#endif /* FIB_VERSION == 1 */ } } else if (n->nd.ndm_family == AF_INET6) { if (n->nd.ndm_state & NUD_REACHABLE) { -#if FIB_VERSION == 1 - vnet_set_ip6_ethernet_neighbor (vm, sw_if_index, - (ip6_address_t *) n->dst, n->lladdr, ETHER_ADDR_LEN, 0); -#else vnet_set_ip6_ethernet_neighbor (vm, sw_if_index, (ip6_address_t *) n->dst, n->lladdr, ETHER_ADDR_LEN, 0 /* static */, 0 /* no fib entry */); -#endif /* FIB_VERSION == 1 */ } else vnet_unset_ip6_ethernet_neighbor (vm, sw_if_index, @@ -194,12 +174,6 @@ add_del_route (ns_route_t * r, int is_del) { u32 stack[MPLS_STACK_DEPTH] = {0}; -#if FIB_VERSION == 1 - ip4_add_del_route_next_hop (&ip4_main, - is_del ? IP4_ROUTE_FLAG_DEL : IP4_ROUTE_FLAG_ADD, - (ip4_address_t *) r->dst, r->rtm.rtm_dst_len, - (ip4_address_t *) r->gateway, sw_if_index, 0, ~0, 0); -#else fib_prefix_t prefix; ip46_address_t nh; @@ -234,16 +208,9 @@ add_del_route (ns_route_t * r, int is_del) FIB_ENTRY_FLAG_NONE, rpaths); } -#endif /* FIB_VERSION == 1 */ } else if (r->rtm.rtm_family == AF_INET6) { -#if FIB_VERSION == 1 - ip6_add_del_route_next_hop (&ip6_main, - is_del ? IP6_ROUTE_FLAG_DEL : IP6_ROUTE_FLAG_ADD, - (ip6_address_t *) r->dst, r->rtm.rtm_dst_len, - (ip6_address_t *) r->gateway, sw_if_index, 0, ~0, 0); -#else fib_prefix_t prefix; ip46_address_t nh; memset (&prefix, 0, sizeof (prefix)); @@ -257,7 +224,6 @@ add_del_route (ns_route_t * r, int is_del) &nh, sw_if_index, 0, 0 /* weight */, NULL, FIB_ROUTE_PATH_FLAG_NONE); -#endif /* FIB_VERSION == 1 */ } else if (r->rtm.rtm_family == AF_MPLS) { |