From: varinder.p Date: Tue, 17 May 2022 03:52:39 +0000 (+0530) Subject: Fixed SLIRP build issue in dibs. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2b2ea653cf7d400398d80fef524da4e91a16d1c6;p=sdk%2Femulator%2Fqemu.git Fixed SLIRP build issue in dibs. Change-Id: Ib7d055055ea98fb08038c0abcfe7b217a9aa87d2 Signed-off-by: varinder.p --- diff --git a/tizen/src/ecs/ecs_msg_device.c b/tizen/src/ecs/ecs_msg_device.c index 4959120778..64e4d55170 100644 --- a/tizen/src/ecs/ecs_msg_device.c +++ b/tizen/src/ecs/ecs_msg_device.c @@ -172,7 +172,6 @@ static void msgproc_device_req_sensor(ECS_Client *ccli, ECS__DeviceReq *msg, cha static void msgproc_device_req_network(ECS_Client *ccli, ECS__DeviceReq *msg, char *cmd) { char *data = NULL; - char ret[2] = {'1', 0}; if (msg->has_data && msg->data.len > 0) { data = (char *) g_malloc0(msg->data.len + 1); memcpy(data, msg->data.data, msg->data.len); @@ -185,12 +184,15 @@ static void msgproc_device_req_network(ECS_Client *ccli, ECS__DeviceReq *msg, ch LOG_SEVERE("Network redirection failed, monitor is null.\n"); goto END; } +#ifdef CONFIG_SLIRP if (maru_hostfwd_add(&mon->common, data) < 0) { + char ret[2] = {'1', 0}; LOG_SEVERE("redirect [%s] fail\n", data); make_send_device_ntf(cmd, MSG_NET_GROUP, MSG_NET_ACTION, ret); } else { LOG_INFO("redirect [%s] success\n", data); } +#endif } else { LOG_SEVERE("Network redirection data is null.\n"); return; diff --git a/tizen/src/util/net_helper.c b/tizen/src/util/net_helper.c index 9266e6a36b..fb93fb4e84 100644 --- a/tizen/src/util/net_helper.c +++ b/tizen/src/util/net_helper.c @@ -122,6 +122,7 @@ static int prepare_network_port(uint32_t base_port) int ret = -1; /* no need to redir if network is tap */ +#ifdef CONFIG_SLIRP if (!is_netclient_tap_attached()) { if (!hostfwd_try_add(0, NULL, base_port + SDB_TCP_INDEX, NULL, SDB_GUEST_PORT)) { @@ -140,16 +141,16 @@ static int prepare_network_port(uint32_t base_port) return -1; } } - +#endif //CONFIG_SLIRP if ((ret = check_port_bind_listen(base_port + ECS_TCP_INDEX)) < 0) { LOG_INFO("TCP port %"PRIu32" is aleady occupied", base_port + ECS_TCP_INDEX); - +#ifdef CONFIG_SLIRP if (!is_netclient_tap_attached()) { hostfwd_try_remove(0, NULL, base_port + SDB_TCP_INDEX); hostfwd_try_remove(0, NULL, base_port + GDB_TCP_INDEX); } - +#endif //CONFIG_SLIRP return -1; }