From 552f5992678ad6a226e0c8216eafed9a795c96ee Mon Sep 17 00:00:00 2001 From: Deepak S Date: Sun, 3 Jun 2018 03:36:25 +0530 Subject: Temp Fix for vFW perf issue Change-Id: I324fcac7a65c0d221d5d422f419deb9c0f864172 Signed-off-by: Deepak S --- common/VIL/gateway/gateway.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'common/VIL/gateway/gateway.c') diff --git a/common/VIL/gateway/gateway.c b/common/VIL/gateway/gateway.c index baf22cf5..7ec3c68f 100644 --- a/common/VIL/gateway/gateway.c +++ b/common/VIL/gateway/gateway.c @@ -122,29 +122,16 @@ uint32_t is_gateway(void) */ void gw_get_nh_port_ipv4(uint32_t dst_ip_addr, - uint32_t *dst_port, uint32_t *nhip) + uint32_t *dst_port, uint32_t *nhip) { - int i; uint32_t j; *nhip = 0; *dst_port = 0xff; - for(j = 0; j < gw_get_num_ports(); j++){ - - for (i = 0; i < p_route_data[j]->route_ent_cnt; i++) { - - if ((p_route_data[j]->route_table[i].nh_mask) == - (dst_ip_addr & - p_route_data[j]->route_table[i].mask)) { - - *dst_port = p_route_data[j]->route_table[i].port; - *nhip = p_route_data[j]->route_table[i].nh; - - lib_arp_nh_found++; - return; - } - } + for(j = 0; j < num_out_ports; j++) { + if (gw_get_route_nh_port_ipv4(dst_ip_addr, dst_port, nhip, j)) + return; } } -- cgit 1.2.3-korg