Modified return error to right value 31/169631/1 accepted/tizen/unified/20180222.080219 accepted/tizen/unified/20180305.152642 submit/tizen/20180221.115722 submit/tizen/20180305.084154
authorhyunuktak <hyunuk.tak@samsung.com>
Thu, 8 Feb 2018 05:19:41 +0000 (14:19 +0900)
committerhyunuktak <hyunuk.tak@samsung.com>
Thu, 8 Feb 2018 05:19:44 +0000 (14:19 +0900)
Change-Id: I99d2cbef1632e7b5ae3bf4fec4bc17e71dce6df6
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
src/helper/helper-ip6tables.c
src/helper/helper-iptables.c

index 8a12e23..064adb5 100755 (executable)
@@ -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);
index 1119b3c..21c2e68 100755 (executable)
@@ -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);