Initialize memory for nfacct rule 47/188247/1
authorhyunuktak <hyunuk.tak@samsung.com>
Mon, 3 Sep 2018 09:26:09 +0000 (18:26 +0900)
committerhyunuktak <hyunuk.tak@samsung.com>
Mon, 3 Sep 2018 09:26:11 +0000 (18:26 +0900)
Change-Id: Iadc6d5a531bc14e450970f6af57672b6f2b9fe66
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
packaging/stc-manager.spec
src/monitor/stc-monitor.c

index d84c351..b75fff7 100644 (file)
@@ -1,6 +1,6 @@
 Name:       stc-manager
 Summary:    STC(Smart Traffic Control) manager
-Version:    0.0.76
+Version:    0.0.77
 Release:    0
 Group:      Network & Connectivity/Other
 License:    Apache-2.0
index 7f28d9c..ebf15a5 100755 (executable)
@@ -760,6 +760,8 @@ static void __add_iptables_rule(int64_t classid, nfacct_rule_intend intend,
                stc->carg->sock = stc_monitor_get_counter_socket(); //LCOV_EXCL_LINE
        }
 
+       memset(&counter, 0, sizeof(struct nfacct_rule));
+
        counter.carg = stc->carg;
        counter.classid = classid;
        counter.intend = intend;
@@ -806,6 +808,8 @@ static void __del_iptables_rule(int64_t classid, nfacct_rule_intend intend,
                stc->carg->sock = stc_monitor_get_counter_socket(); //LCOV_EXCL_LINE
        }
 
+       memset(&counter, 0, sizeof(struct nfacct_rule));
+
        counter.carg = stc->carg;
        counter.classid = classid;
        counter.intend = intend;
@@ -1602,6 +1606,8 @@ static gboolean __reset_time_counter_foreach_rstn(gpointer key,
                                                stc_monitor_get_counter_socket();
                                }
 
+                               memset(&counter, 0, sizeof(struct nfacct_rule));
+
                                counter.carg = stc->carg;
                                counter.classid = rstn_value->classid;
                                counter.intend = NFACCT_BLOCK;