From d7d0c6b61fc56bd65a385606c92d1b16e067f4f8 Mon Sep 17 00:00:00 2001 From: Nishant Chaprana Date: Tue, 13 Jun 2017 14:38:06 +0530 Subject: [PATCH] Blocking incoming and outgoing traffic when specified limits are crosssed. Change-Id: I39e872adf9980b457a2b4427ce06c5798ed88f14 Signed-off-by: Nishant Chaprana --- packaging/stc-manager.spec | 2 +- src/monitor/stc-monitor.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packaging/stc-manager.spec b/packaging/stc-manager.spec index 4852a41..d62e979 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.13 +Version: 0.0.14 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 3015b51..a0a58ff 100755 --- a/src/monitor/stc-monitor.c +++ b/src/monitor/stc-monitor.c @@ -570,8 +570,10 @@ static gboolean __rstn_counter_update_foreach_classid(gpointer key, /* block immediately */ if (rstn_value->counter.in_bytes >= rstn_value->limit.in_bytes) { + context->counter->intend = NFACCT_BLOCK; __del_iptables_in(context->counter); __add_iptables_in(context->counter); + context->counter->intend = NFACCT_COUNTER; rstn_value->in_limit_reached = TRUE; if (rstn_value->rstn_limit_crossed_notified == FALSE) { @@ -612,8 +614,10 @@ static gboolean __rstn_counter_update_foreach_classid(gpointer key, /* block immediately */ if (rstn_value->counter.out_bytes >= rstn_value->limit.out_bytes) { + context->counter->intend = NFACCT_BLOCK; __del_iptables_out(context->counter); __add_iptables_out(context->counter); + context->counter->intend = NFACCT_COUNTER; rstn_value->out_limit_reached = TRUE; if (rstn_value->rstn_limit_crossed_notified == FALSE) { -- 2.7.4