From 31a24b656050878af31122b085a345cfe35e742b Mon Sep 17 00:00:00 2001 From: Hongjun Ni Date: Tue, 7 Aug 2018 23:40:48 +0800 Subject: Remove FIB_1.0 support and fix FIB_2.0 issue Change-Id: I90e593993851a364b728034c13e8e69852b558c4 Signed-off-by: Hongjun Ni --- netlink/librtnl/mapper.c | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'netlink') diff --git a/netlink/librtnl/mapper.c b/netlink/librtnl/mapper.c index 05b7f1d..207013c 100644 --- a/netlink/librtnl/mapper.c +++ b/netlink/librtnl/mapper.c @@ -18,13 +18,7 @@ #include #include - -#ifdef ip6_add_del_route_next_hop -#define FIB_VERSION 1 -#else #include -#define FIB_VERSION 2 -#endif typedef struct { int linux_ifindex; @@ -70,18 +64,6 @@ int mapper_add_del_route(mapper_ns_t *ns, ns_route_t *route, int del) if (route->rtm.rtm_dst_len >= 8 && route->dst[0] == 0xff) return 0; -#if FIB_VERSION == 1 - struct ip6_main_t *im = &ip6_main; - ip6_add_del_route_next_hop(im, //ip6_main - del?IP6_ROUTE_FLAG_DEL:IP6_ROUTE_FLAG_ADD, //flags (not del) - (ip6_address_t *)&route->dst[0], //Dst addr - route->rtm.rtm_dst_len, //Plen - (ip6_address_t *)&route->gateway[0], //next-hop - map->sw_if_index, //sw_if_index - 0, //weight - ~0, //adj_index - ns->v6fib_index); -#else fib_prefix_t prefix; ip46_address_t nh; @@ -99,20 +81,7 @@ int mapper_add_del_route(mapper_ns_t *ns, ns_route_t *route, int del) 0 /* weight */, (fib_mpls_label_t *) MPLS_LABEL_INVALID, FIB_ROUTE_PATH_FLAG_NONE); -#endif /* FIB_VERSION == 1 */ } else { -#if FIB_VERSION == 1 - struct ip4_main_t *im = &ip4_main; - ip4_add_del_route_next_hop(im, //ip4_main - del?IP4_ROUTE_FLAG_DEL:IP4_ROUTE_FLAG_ADD, //flags (not del) - (ip4_address_t *)&route->dst[0], //Dst addr - route->rtm.rtm_dst_len, //Plen - (ip4_address_t *)&route->gateway[0], //next-hop - map->sw_if_index, //sw_if_index - 0, //weight - ~0, //adj_index - ns->v4fib_index); -#else fib_prefix_t prefix; ip46_address_t nh; @@ -130,7 +99,6 @@ int mapper_add_del_route(mapper_ns_t *ns, ns_route_t *route, int del) 0 /* weight */, (fib_mpls_label_t *) MPLS_LABEL_INVALID, FIB_ROUTE_PATH_FLAG_NONE); -#endif /* FIB_VERSION == 1 */ } return 0; -- cgit