From: hyunuktak Date: Thu, 8 Feb 2018 05:19:41 +0000 (+0900) Subject: Modified return error to right value X-Git-Tag: accepted/tizen/unified/20180222.080219^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ff3562722b95861a24de879001a8fd67598505de;p=platform%2Fcore%2Fconnectivity%2Fstc-iptables.git Modified return error to right value Change-Id: I99d2cbef1632e7b5ae3bf4fec4bc17e71dce6df6 Signed-off-by: hyunuktak --- diff --git a/src/helper/helper-ip6tables.c b/src/helper/helper-ip6tables.c index 8a12e23..064adb5 100755 --- a/src/helper/helper-ip6tables.c +++ b/src/helper/helper-ip6tables.c @@ -186,7 +186,7 @@ int ip6tables_add_rule(ip6tables_rule_s *rule) if (!ip6tc_commit(handle)) { STC_LOGE("Failed to ip6tc_commit [%s]", ip6tc_strerror(errno)); //LCOV_EXCL_LINE ip6tc_free(handle); //LCOV_EXCL_LINE - return STC_ERROR_INVALID_OPERATION; //LCOV_EXCL_LINE + return STC_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE } ip6tc_free(handle); @@ -223,13 +223,13 @@ int ip6tables_remove_rule(ip6tables_rule_s *rule) if (!ip6tc_delete_entry(chain, (const ip6t_entry_t *)entry, mask, handle)) { STC_LOGW("ip6tc_delete_entry failed [%s]", ip6tc_strerror(errno)); //LCOV_EXCL_LINE ip6tc_free(handle); //LCOV_EXCL_LINE - return STC_ERROR_INVALID_OPERATION; //LCOV_EXCL_LINE + return STC_ERROR_NONE; //LCOV_EXCL_LINE } if (!ip6tc_commit(handle)) { STC_LOGE("Failed to ip6tc_commit [%s]", ip6tc_strerror(errno)); //LCOV_EXCL_LINE ip6tc_free(handle); //LCOV_EXCL_LINE - return STC_ERROR_INVALID_OPERATION; //LCOV_EXCL_LINE + return STC_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE } ip6tc_free(handle); @@ -263,7 +263,7 @@ int ip6tables_add_chain(const char *chain) if (!ip6tc_commit(handle)) { STC_LOGE("Failed to ip6tc_commit [%s]", ip6tc_strerror(errno)); //LCOV_EXCL_LINE ip6tc_free(handle); //LCOV_EXCL_LINE - return STC_ERROR_INVALID_OPERATION; //LCOV_EXCL_LINE + return STC_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE } ip6tc_free(handle); @@ -299,7 +299,7 @@ int ip6tables_remove_chain(const char *chain) if (!ip6tc_commit(handle)) { STC_LOGE("Failed to ip6tc_commit [%s]", ip6tc_strerror(errno)); //LCOV_EXCL_LINE ip6tc_free(handle); //LCOV_EXCL_LINE - return STC_ERROR_INVALID_OPERATION; //LCOV_EXCL_LINE + return STC_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE } ip6tc_free(handle); @@ -333,7 +333,7 @@ int ip6tables_flush_chain(const char *chain) if (!ip6tc_commit(handle)) { STC_LOGE("Failed to ip6tc_commit [%s]", ip6tc_strerror(errno)); //LCOV_EXCL_LINE ip6tc_free(handle); //LCOV_EXCL_LINE - return STC_ERROR_INVALID_OPERATION; //LCOV_EXCL_LINE + return STC_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE } ip6tc_free(handle); diff --git a/src/helper/helper-iptables.c b/src/helper/helper-iptables.c index 1119b3c..21c2e68 100755 --- a/src/helper/helper-iptables.c +++ b/src/helper/helper-iptables.c @@ -186,7 +186,7 @@ int iptables_add_rule(iptables_rule_s *rule) if (!iptc_commit(handle)) { STC_LOGE("Failed to iptc_commit [%s]", iptc_strerror(errno)); //LCOV_EXCL_LINE iptc_free(handle); //LCOV_EXCL_LINE - return STC_ERROR_INVALID_OPERATION; //LCOV_EXCL_LINE + return STC_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE } iptc_free(handle); @@ -223,13 +223,13 @@ int iptables_remove_rule(iptables_rule_s *rule) if (!iptc_delete_entry(chain, (const ipt_entry_t *)entry, mask, handle)) { STC_LOGW("iptc_delete_entry failed [%s]", iptc_strerror(errno)); //LCOV_EXCL_LINE iptc_free(handle); //LCOV_EXCL_LINE - return STC_ERROR_INVALID_OPERATION; //LCOV_EXCL_LINE + return STC_ERROR_NONE; //LCOV_EXCL_LINE } if (!iptc_commit(handle)) { STC_LOGE("Failed to iptc_commit [%s]", iptc_strerror(errno)); //LCOV_EXCL_LINE iptc_free(handle); //LCOV_EXCL_LINE - return STC_ERROR_INVALID_OPERATION; //LCOV_EXCL_LINE + return STC_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE } iptc_free(handle); @@ -263,7 +263,7 @@ int iptables_add_chain(const char *chain) if (!iptc_commit(handle)) { STC_LOGE("Failed to iptc_commit [%s]", iptc_strerror(errno)); //LCOV_EXCL_LINE iptc_free(handle); //LCOV_EXCL_LINE - return STC_ERROR_INVALID_OPERATION; //LCOV_EXCL_LINE + return STC_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE } iptc_free(handle); @@ -299,7 +299,7 @@ int iptables_remove_chain(const char *chain) if (!iptc_commit(handle)) { STC_LOGE("Failed to iptc_commit [%s]", iptc_strerror(errno)); //LCOV_EXCL_LINE iptc_free(handle); //LCOV_EXCL_LINE - return STC_ERROR_INVALID_OPERATION; //LCOV_EXCL_LINE + return STC_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE } iptc_free(handle); @@ -333,7 +333,7 @@ int iptables_flush_chain(const char *chain) if (!iptc_commit(handle)) { STC_LOGE("Failed to iptc_commit [%s]", iptc_strerror(errno)); //LCOV_EXCL_LINE iptc_free(handle); //LCOV_EXCL_LINE - return STC_ERROR_INVALID_OPERATION; //LCOV_EXCL_LINE + return STC_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE } iptc_free(handle);