-
Notifications
You must be signed in to change notification settings - Fork 44
RDKB-64265 Hardcoded WAN Interface Name (erouter0) in Business Gateway Feature #282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -187,10 +187,6 @@ int numifs = sizeof(ifnames) / sizeof(*ifnames); | |
| #define V6_PORTSCANPROTECT "v6_PortScanProtect" | ||
| #define V6_IPFLOODDETECT "v6_IPFloodDetect" | ||
|
|
||
| #ifdef _ONESTACK_PRODUCT_REQ_ | ||
| #define COSA_DML_DHCPV6_CLIENT_IFNAME "erouter0" | ||
| #define COSA_DML_DHCPV6C_PREF_SYSEVENT_NAME "tr_"COSA_DML_DHCPV6_CLIENT_IFNAME"_dhcpv6_client_v6pref" | ||
| #endif | ||
| /* | ||
| **************************************************************** | ||
| * IPv6 Firewall * | ||
|
|
@@ -496,6 +492,10 @@ void do_ipv6_filter_table(FILE *fp){ | |
| char request[256], response[256], cm_ipv6addr[40]; | ||
| unsigned int a[16] = {0}; | ||
| #endif | ||
| #if defined (_ONESTACK_PRODUCT_REQ_) | ||
| char current_wan_interface[64] = {0}; | ||
| char sysevent_name[128] = {0}; | ||
| #endif | ||
|
|
||
| fprintf(fp, "*filter\n"); | ||
| fprintf(fp, ":INPUT ACCEPT [0:0]\n"); | ||
|
|
@@ -1263,22 +1263,27 @@ void do_ipv6_filter_table(FILE *fp){ | |
| #ifdef _ONESTACK_PRODUCT_REQ_ | ||
| if(isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | ||
| { | ||
| sysevent_get(sysevent_fd, sysevent_token, COSA_DML_DHCPV6C_PREF_SYSEVENT_NAME, prefix, sizeof(prefix)); | ||
| sysevent_get(sysevent_fd, sysevent_token, "current_wan_ifname", current_wan_interface, sizeof(current_wan_interface)); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hello ,
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ipv6_prefix doesn't show the right prefix length, even though server sends /56, ipv6_prefix hard codes it to /64 which is wrong. If this issue is fixed, we can use ipv6_prefix.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hello @snayak002c
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @S-Parthiban-Selvaraj , This change is on XB10 one stack which supports both residential / business mode based on the partnerID/device mode. We can't enable CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION MACRO on this platform. BTW why are we setting ipv6 prefix length differently on residential/ business. Shouldn't it return what it received from the server? |
||
| snprintf(sysevent_name, sizeof(sysevent_name), "tr_%s_dhcpv6_client_v6pref", current_wan_interface); | ||
| sysevent_get(sysevent_fd, sysevent_token, sysevent_name, prefix, sizeof(prefix)); | ||
rirfha948 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| else | ||
| { | ||
| sysevent_get(sysevent_fd, sysevent_token, "ipv6_prefix", prefix, sizeof(prefix)); | ||
| sysevent_get(sysevent_fd, sysevent_token, "ipv6_prefix", prefix, sizeof(prefix)); | ||
| } | ||
| #else | ||
| sysevent_get(sysevent_fd, sysevent_token, "ipv6_prefix", prefix, sizeof(prefix)); | ||
| sysevent_get(sysevent_fd, sysevent_token, "ipv6_prefix", prefix, sizeof(prefix)); | ||
| #endif | ||
| } | ||
|
|
||
| #else | ||
| #ifdef _ONESTACK_PRODUCT_REQ_ | ||
| if(isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | ||
| { | ||
| sysevent_get(sysevent_fd, sysevent_token, COSA_DML_DHCPV6C_PREF_SYSEVENT_NAME, prefix, sizeof(prefix)); | ||
| sysevent_get(sysevent_fd, sysevent_token, "current_wan_ifname", current_wan_interface, sizeof(current_wan_interface)); | ||
| snprintf(sysevent_name, sizeof(sysevent_name), "tr_%s_dhcpv6_client_v6pref", current_wan_interface); | ||
| sysevent_get(sysevent_fd, sysevent_token, sysevent_name, prefix, sizeof(prefix)); | ||
rirfha948 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| } | ||
| else | ||
| { | ||
|
|
@@ -1300,7 +1305,7 @@ void do_ipv6_filter_table(FILE *fp){ | |
| #if defined (_COSA_FOR_BCI_) || defined (_ONESTACK_PRODUCT_REQ_) | ||
| /* adding forward rule for PD traffic */ | ||
| #ifdef _ONESTACK_PRODUCT_REQ_ | ||
| if(isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | ||
| if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | ||
| { | ||
| fprintf(fp, "-A FORWARD -s %s -i %s -j ACCEPT\n", prefix, lan_ifname); | ||
| if (strncasecmp(firewall_levelv6, "Custom", strlen("Custom")) == 0) | ||
|
|
@@ -2134,6 +2139,10 @@ typedef enum{ | |
| void applyRoutingRules(FILE* fp,ipv6_type type) | ||
| { | ||
| FIREWALL_DEBUG("Entering applyRoutingRules, ipv6_type is %d \n" COMMA type); | ||
| #if defined (_ONESTACK_PRODUCT_REQ_) | ||
| char current_wan_interface[64] = {0}; | ||
| char sysevent_name[128] = {0}; | ||
| #endif | ||
| char prefix[64] ; | ||
| memset(prefix,0,sizeof(prefix)); | ||
| int i ; | ||
|
|
@@ -2143,20 +2152,37 @@ void applyRoutingRules(FILE* fp,ipv6_type type) | |
| } | ||
| else | ||
| { | ||
| #ifdef _ONESTACK_PRODUCT_REQ_ | ||
| if(isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | ||
| #ifdef _ONESTACK_PRODUCT_REQ_ | ||
| if(isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | ||
| { | ||
| sysevent_get(sysevent_fd, sysevent_token, COSA_DML_DHCPV6C_PREF_SYSEVENT_NAME, prefix, sizeof(prefix)); | ||
| sysevent_get(sysevent_fd, sysevent_token, "current_wan_ifname", current_wan_interface, sizeof(current_wan_interface)); | ||
| if (current_wan_interface[0] != '\0') | ||
| { | ||
| snprintf(sysevent_name, sizeof(sysevent_name), "tr_%s_dhcpv6_client_v6pref", current_wan_interface); | ||
| sysevent_get(sysevent_fd, sysevent_token, sysevent_name, prefix, sizeof(prefix)); | ||
| } | ||
| else | ||
| { | ||
| sysevent_get(sysevent_fd, sysevent_token, "ipv6_prefix", prefix, sizeof(prefix)); | ||
| } | ||
| } | ||
| else | ||
| { | ||
| sysevent_get(sysevent_fd, sysevent_token, "ipv6_prefix", prefix, sizeof(prefix)); | ||
| } | ||
| #else | ||
| #else | ||
| sysevent_get(sysevent_fd, sysevent_token, "ipv6_prefix", prefix, sizeof(prefix)); | ||
| #endif | ||
| #endif | ||
| } | ||
| if (strlen(prefix) != 0 ) | ||
| /* Add firewall rules only if prefix is non-empty and, when IPv6 delegation is enabled, current_wan_interface is also non-empty */ | ||
| #ifdef _ONESTACK_PRODUCT_REQ_ | ||
| if ((strlen(prefix) != 0) && | ||
| (!isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION) || | ||
rirfha948 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| (ULA_IPV6 == type) || | ||
| (strlen(current_wan_interface) != 0))) | ||
rirfha948 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| #else | ||
| if (strlen(prefix) != 0) | ||
| #endif | ||
| { | ||
| char *token_pref =NULL; | ||
| token_pref = strtok(prefix,"/"); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.