| Igmpproxy currently doesn't support configurable query interval. |
| Add configuration option 'queryinterval' to set custom query interval |
| and also add configuration option 'reportforwarding' to enable/disable |
| forwarding IGMP membership reports upstream. |
| |
| Reviewed on https://chromium-review.googlesource.com/2205180 |
| |
| --- |
| diff -Naur --show-c-function a/src/config.c b/src/config.c |
| --- a/src/config.c 2020-05-15 23:37:48.036277661 -0700 |
| +++ b/src/config.c 2020-05-15 23:33:38.045136599 -0700 |
| @@ -87,6 +87,9 @@ static void initCommonConfig(void) { |
| // aimwang: default value |
| commonConfig.defaultInterfaceState = IF_STATE_DISABLED; |
| commonConfig.rescanVif = 0; |
| + |
| + // Default values for reportForwarding. |
| + commonConfig.reportForwarding = 0; |
| } |
| |
| /** |
| @@ -170,6 +173,26 @@ int loadConfig(char *configFile) { |
| |
| // Read next token... |
| token = nextConfigToken(); |
| + continue; |
| + } |
| + else if(strcmp("queryinterval", token)==0) { |
| + // Got a queryinterval token... |
| + token = nextConfigToken(); |
| + my_log(LOG_DEBUG, 0, "Config: Got queryinterval token : %s", token); |
| + commonConfig.queryInterval = atoi( token ); |
| + commonConfig.startupQueryInterval = (commonConfig.queryInterval / 4); |
| + |
| + // Read next token... |
| + token = nextConfigToken(); |
| + continue; |
| + } |
| + else if(strcmp("reportforwarding", token)==0) { |
| + // Got a reportforwarding token... |
| + my_log(LOG_DEBUG, 0, "Config: Need to forward membership reports."); |
| + commonConfig.reportForwarding = 1; |
| + |
| + // Read next token... |
| + token = nextConfigToken(); |
| continue; |
| } else { |
| // Unparsable token... Exit... |
| diff -Naur --show-c-function a/src/igmpproxy.h b/src/igmpproxy.h |
| --- a/src/igmpproxy.h 2020-05-15 23:38:08.544207561 -0700 |
| +++ b/src/igmpproxy.h 2020-05-15 23:29:40.149962872 -0700 |
| @@ -177,6 +177,8 @@ struct Config { |
| // Set if not detect new interface for down stream. |
| unsigned short defaultInterfaceState; // 0: disable, 2: downstream |
| //~ aimwang added done |
| + // Set if need to forward membership reports |
| + unsigned short reportForwarding; |
| }; |
| |
| // Holds the indeces of the upstream IF... |
| diff -Naur --show-c-function a/src/rttable.c b/src/rttable.c |
| --- a/src/rttable.c 2020-05-15 23:38:27.012144473 -0700 |
| +++ b/src/rttable.c 2020-05-15 23:36:32.340536868 -0700 |
| @@ -391,8 +391,10 @@ int insertRoute(uint32_t group, int ifx) |
| // Send Join request upstream |
| sendJoinLeaveUpstream(croute, 1); |
| } else { |
| + if(conf->reportForwarding) { |
| // Send Report upstream |
| sendReportUpstream(group); |
| + } |
| } |
| |
| logRouteTable("Insert Route"); |