Skip to content
Snippets Groups Projects
Commit c94ef149 authored by George Yang's avatar George Yang Committed by Reidar Cederqvist
Browse files

J#IM-11: IGMP Fast Leave

- Enable IGMP Fast Leave by setting UCI
mcproxy.mcproxy.fastleave='1'

- Disable IGMP Fast Leave by setting UCI
mcproxy.mcproxy.fastleave='0'

- By default, IGMP Fast Leave is disabled.

Change-Id: I2ad9c979c7554cd6b17f647d198cda5089016551
parent 5096f57a
Branches
Tags
1 merge request!1J#IM-11: IGMP Fast Leave
Pipeline #51 failed
......@@ -2,6 +2,7 @@
config mcproxy 'mcproxy'
option disabled '0'
option respawn '1'
option fastleave '0'
option protocol 'IGMPv2'
option force_protocol '1'
# option query_interval '125'
......
......@@ -152,6 +152,10 @@ start_instance() {
config_get protocol "$cfg" "protocol" "IGMPv3"
echo -e "protocol ${protocol};\n" > $conf_file
local fastleave
config_get fastleave "$cfg" "fastleave" "0"
echo -e "fastleave ${fastleave};\n" >> $conf_file
local force_protocol
config_get_bool force_protocol "$cfg" "force_protocol" 0
echo 0 > /proc/sys/net/ipv4/conf/all/force_igmp_version
......
--- a/mcproxy/include/proxy/timers_values.hpp 2019-08-28 15:50:29.601704202 +0200
+++ b/mcproxy/include/proxy/timers_values.hpp 2019-08-28 16:00:27.043074882 +0200
@@ -36,6 +36,7 @@ struct timers_values_tank {
std::chrono::milliseconds last_listener_query_interval = std::chrono::milliseconds(1000);
unsigned int last_listener_query_count = robustness_variable;
std::chrono::milliseconds unsolicited_report_interval = std::chrono::milliseconds(1000);
+ bool fastleave = false;
};
static timers_values_tank default_timers_values_tank = timers_values_tank();
@@ -82,6 +83,7 @@ public:
std::chrono::milliseconds get_last_listener_query_time() const; //
std::chrono::milliseconds get_unsolicited_report_interval() const;
std::chrono::milliseconds get_older_host_present_interval() const; //
+ bool get_fastleave() const;
void set_robustness_variable(unsigned int robustness_variable);
void set_query_interval(std::chrono::seconds query_interval);
@@ -91,6 +93,7 @@ public:
void set_last_listener_query_interval(std::chrono::milliseconds last_listener_query_interval);
void set_last_listener_query_count(unsigned int last_listener_query_count);
void set_unsolicited_report_interval(std::chrono::milliseconds unsolicited_report_interval);
+ void set_fastleave(bool fastleave);
void reset_to_default_tank();
--- a/mcproxy/include/parser/configuration.hpp 2019-08-28 15:50:29.609703792 +0200
+++ b/mcproxy/include/parser/configuration.hpp 2019-08-28 16:03:41.841095157 +0200
@@ -45,7 +45,7 @@ private:
int m_qri = -1; // Query response interval
int m_lmqi = -1; // Last member Query interval
int m_rv = -1; // robustness value
- bool m_fastleave = true; // Fast leave
+ bool m_fastleave = false; // Fast leave
//<line number (for a better error message output), command>
std::vector<std::pair<unsigned int, std::string>> m_cmds;
--- a/mcproxy/src/proxy/querier.cpp 2019-08-28 15:50:29.613703587 +0200
+++ b/mcproxy/src/proxy/querier.cpp 2019-08-30 17:07:00.287689355 +0200
@@ -163,7 +163,13 @@ void querier::receive_record(const std::
break;
case EXCLUDE_MODE:
- receive_record_in_exclude_mode(gr->get_record_type(), gr->get_gaddr(), gr->get_slist(), db_info_it->second);
+ if (m_timers_values.get_fastleave() && gr->get_record_type() == CHANGE_TO_INCLUDE_MODE && gr->get_slist().empty()) {
+ send_Q(gr->get_gaddr(), db_info_it->second);
+ m_db.group_info.erase(db_info_it);
+ state_change_notification(gr->get_gaddr());
+ } else
+ receive_record_in_exclude_mode(gr->get_record_type(), gr->get_gaddr(), gr->get_slist(), db_info_it->second);
+
break;
default :
HC_LOG_ERROR("wrong filter mode: " << db_info_it->second.filter_mode);
--- a/mcproxy/src/proxy/timers_values.cpp 2019-08-28 15:50:29.621703177 +0200
+++ b/mcproxy/src/proxy/timers_values.cpp 2019-08-28 16:06:03.917816941 +0200
@@ -176,6 +176,12 @@ uint16_t timers_values::maxrespi_to_maxr
}
//--------------------------------------
+bool timers_values::get_fastleave() const
+{
+ HC_LOG_TRACE("");
+ return tank->fastleave;
+}
+
unsigned int timers_values::get_robustness_variable() const
{
HC_LOG_TRACE("");
@@ -271,6 +277,13 @@ void timers_values::reset_to_default_tan
}
//--------------------------------------
+void timers_values::set_fastleave(bool fastleave)
+{
+ HC_LOG_TRACE("");
+ set_new_tank();
+ tank->fastleave = fastleave;
+}
+
void timers_values::set_robustness_variable(unsigned int robustness_variable)
{
HC_LOG_TRACE("");
--- a/mcproxy/src/proxy/proxy.cpp 2019-08-28 15:50:29.625702972 +0200
+++ b/mcproxy/src/proxy/proxy.cpp 2019-08-28 16:10:27.584311145 +0200
@@ -276,7 +276,9 @@ void proxy::start_proxy_instances()
tv.set_startup_query_count(val);
}
- std::cout << "fastleave :" <<m_configuration->get_fastleave() <<std::endl;
+ bool fastleave = m_configuration->get_fastleave();
+ std::cout << "fastleave :" <<fastleave <<std::endl;
+ tv.set_fastleave(fastleave);
pr_i->add_msg(std::make_shared<config_msg>(config_msg::ADD_DOWNSTREAM, if_index, d, tv));
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment