From: hyunuktak Date: Mon, 3 Sep 2018 09:26:09 +0000 (+0900) Subject: Initialize memory for nfacct rule X-Git-Tag: accepted/tizen/unified/20180906.054612^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fconnectivity%2Fstc-manager.git;a=commitdiff_plain;h=6bd0d8efb2ad6978205f4f76832cc83ae7761a30 Initialize memory for nfacct rule Change-Id: Iadc6d5a531bc14e450970f6af57672b6f2b9fe66 Signed-off-by: hyunuktak --- diff --git a/packaging/stc-manager.spec b/packaging/stc-manager.spec index d84c351..b75fff7 100644 --- a/packaging/stc-manager.spec +++ b/packaging/stc-manager.spec @@ -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 diff --git a/src/monitor/stc-monitor.c b/src/monitor/stc-monitor.c index 7f28d9c..ebf15a5 100755 --- a/src/monitor/stc-monitor.c +++ b/src/monitor/stc-monitor.c @@ -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;