-
Notifications
You must be signed in to change notification settings - Fork 41
RDKB-63098: Handle IPv6 delegation for business vs residential Partner ID as part of single build #215
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?
RDKB-63098: Handle IPv6 delegation for business vs residential Partner ID as part of single build #215
Changes from all commits
349c745
b70d5a5
be65456
43bac50
b61e2e1
6870c72
031c75c
45741d6
4a090a1
036eeff
39458cc
289bdf7
5ce4966
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 |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| /* | ||
| * If not stated otherwise in this file or this component's Licenses.txt file the | ||
|
Check failure on line 2 in source/firewall/firewall_ipv6.c
|
||
| * following copyright and licenses apply: | ||
| * | ||
| * Copyright 2015 RDK Management | ||
|
|
@@ -98,6 +98,9 @@ | |
| #include <net/if.h> | ||
| #endif | ||
|
|
||
| #ifdef _ONESTACK_PRODUCT_REQ_ | ||
| #include <rdkb_feature_mode_gate.h> | ||
| #endif | ||
| void* bus_handle ; | ||
| int sysevent_fd; | ||
| char sysevent_ip[19]; | ||
|
|
@@ -862,11 +865,17 @@ | |
| } | ||
| #endif /*_HUB4_PRODUCT_REQ_*/ | ||
|
|
||
| #if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) && ! defined(_CBR_PRODUCT_REQ_) | ||
| #if (defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) && !defined(_CBR_PRODUCT_REQ_)) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| if ( isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION) == true) | ||
| #endif | ||
| { | ||
|
|
||
| /*Add a simple logic here to make traffic allowed for lan interfaces | ||
| * exclude primary lan*/ | ||
| prepare_ipv6_multinet(fp); | ||
| #endif | ||
| } | ||
| #endif | ||
| #if !defined(_XER5_PRODUCT_REQ_) && !defined (_SCER11BEL_PRODUCT_REQ_) && !defined(_COSA_QCA_ARM_) //wan0 is not applicable for XER5 | ||
| /* not allow ping wan0 from brlan0 */ | ||
| int i; | ||
|
|
@@ -1705,9 +1714,17 @@ | |
| FIREWALL_DEBUG("Exiting prepare_ipv6_firewall \n"); | ||
| } | ||
|
|
||
| #if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) && ! defined(_CBR_PRODUCT_REQ_) | ||
| static int prepare_ipv6_multinet(FILE *fp) | ||
| #if (defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) && !defined(_CBR_PRODUCT_REQ_)) \ | ||
| || defined(_ONESTACK_PRODUCT_REQ_) | ||
| int prepare_ipv6_multinet(FILE *fp) | ||
| { | ||
| #ifdef _ONESTACK_PRODUCT_REQ_ | ||
| if (!isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | ||
| { | ||
| /* PD feature disabled */ | ||
| return 0; | ||
| } | ||
| #endif | ||
| char active_insts[32] = {0}; | ||
| char lan_pd_if[128] = {0}; | ||
| char *p = NULL; | ||
|
Comment on lines
+1719
to
1730
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| /************************************************************************************ | ||
|
Check failure on line 1 in source/service_ipv6/service_ipv6.c
|
||
| If not stated otherwise in this file or this component's Licenses.txt file the | ||
| following copyright and licenses apply: | ||
|
|
||
|
|
@@ -53,6 +53,9 @@ | |
| #include "ccsp_memory.h" | ||
| #endif | ||
|
|
||
| #ifdef _ONESTACK_PRODUCT_REQ_ | ||
| #include <rdkb_feature_mode_gate.h> | ||
| #endif | ||
| #ifdef _HUB4_PRODUCT_REQ_ | ||
| #include "ccsp_dm_api.h" | ||
| #include "ccsp_custom.h" | ||
|
|
@@ -391,10 +394,21 @@ | |
| DHCPV6S_SYSCFG_GETI(DHCPV6S_NAME, "pool", cfg->index, "", 0, "X_RDKCENTRAL_COM_DNSServersEnabled", cfg->X_RDKCENTRAL_COM_DNSServersEnabled); | ||
|
|
||
| #ifdef MULTILAN_FEATURE | ||
| #ifdef CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION | ||
| DHCPV6S_SYSCFG_GETS(DHCPV6S_NAME, "pool", cfg->index, "", 0, "IAInterface", iface_name); | ||
| #else | ||
| DHCPV6S_SYSCFG_GETS(DHCPV6S_NAME, "pool", cfg->index, "", 0, "Interface", iface_name); | ||
| #if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION) == true) | ||
| #endif | ||
| { | ||
| DHCPV6S_SYSCFG_GETS(DHCPV6S_NAME, "pool", cfg->index, "", 0, "IAInterface", iface_name); | ||
| } | ||
| #endif | ||
| #if !defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION) == false) | ||
| #endif | ||
| { | ||
| DHCPV6S_SYSCFG_GETS(DHCPV6S_NAME, "pool", cfg->index, "", 0, "Interface", iface_name); | ||
| } | ||
|
Comment on lines
+397
to
+411
|
||
| #endif | ||
| #else | ||
| DHCPV6S_SYSCFG_GETS(DHCPV6S_NAME, "pool", cfg->index, "", 0, "IAInterface", cfg->interface); | ||
|
|
@@ -606,7 +620,7 @@ | |
| STATIC int get_active_lanif(struct serv_ipv6 *si6, unsigned int insts[], unsigned int *num) | ||
| { | ||
| int i = 0; | ||
| #if !defined(MULTILAN_FEATURE) || defined CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION | ||
| #if !defined(MULTILAN_FEATURE) || defined CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION || defined(_ONESTACK_PRODUCT_REQ_) | ||
| char active_insts[32] = {0}; | ||
| char lan_pd_if[128] = {0}; | ||
| char *p = NULL; | ||
|
|
@@ -628,7 +642,11 @@ | |
| unsigned int max_active_if_count = 0; | ||
| int primary_l3_instance = 0; | ||
|
|
||
| #ifdef CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION | ||
| #if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | ||
| #endif | ||
| { | ||
| syscfg_get(NULL, "lan_pd_interfaces", lan_pd_if, sizeof(lan_pd_if)); | ||
| if (lan_pd_if[0] == '\0') { | ||
| *num = 0; | ||
|
|
@@ -648,7 +666,14 @@ | |
|
|
||
| p = strtok(NULL, " "); | ||
| } | ||
| #else | ||
| } | ||
| #endif | ||
| #if !defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| if (!isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | ||
| #endif | ||
| { | ||
|
|
||
| /* Get active bridge count from PSM */ | ||
| if (!bus_handle) { | ||
| fprintf(stderr, "DBUS not connected, returning \n"); | ||
|
|
@@ -718,6 +743,7 @@ | |
| } | ||
| /* Set active IPv6 instances */ | ||
| sysevent_set(si6->sefd, si6->setok, "ipv6_active_inst", active_if_list, 0); | ||
| } | ||
| #endif | ||
|
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Within prepare_ipv6_multinet(), the code later does a do/while loop that formats with the first token from strtok(active_insts, " "). If the sysevent value "multinet-instances" is empty, strtok returns NULL and that loop will dereference a NULL pointer. Add an early return when the first token is NULL (or switch to a while(token != NULL) loop).