-
Notifications
You must be signed in to change notification settings - Fork 46
RDKB-58910 : Move the WAN IPV6 configuration from LAN bridge #79
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: main
Are you sure you want to change the base?
Changes from all commits
8a6345d
03d4221
7c64ad1
f3dd4d8
d072a94
9b1e269
c124798
3a84b22
62c630b
b8aea40
1e13651
0e0ba2d
f0bd16d
f45f83c
dd2db9c
ff18e4b
6dd2568
7f06a7c
7828845
a176136
5c6acd8
bf284f6
2ab8724
8bb4369
f55d1b5
d312132
2645592
08d79e1
0802ac5
ab841a4
9384b5a
dcc4531
842125d
e9d4743
c7c4892
c809027
78211db
d65deed
38038da
99488a3
df36c4a
ceb1ca2
9966ecf
1f87a30
92faa23
b210936
715f5ca
0abe743
f229450
dfa93ba
ba6daf0
60d5bb3
356fa90
81e1c83
777eaa8
e009be8
c32564a
90b5283
8d90cb3
f37c08d
55f2c3f
57e6d9c
24a976c
ef40e85
d75a9a7
414fd9d
b7c30de
287e1f7
86ed474
42bf6ea
e0d8789
c1adbfb
2a5f4e8
912fc65
1b44dc1
ed6da65
c8b4a7c
e81e35e
5079060
1398ead
2754e4d
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 | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -104,6 +104,17 @@ static void copyDhcpv6Data(WANMGR_IPV6_DATA* pDhcpv6Data, const DHCP_MGR_IPV6_MS | |||||||||||||||||||||
| pDhcpv6Data->prefixAssigned = leaseInfo->prefixAssigned; | ||||||||||||||||||||||
| pDhcpv6Data->domainNameAssigned = leaseInfo->domainNameAssigned; | ||||||||||||||||||||||
| pDhcpv6Data->ipv6_TimeOffset = leaseInfo->ipv6_TimeOffset; | ||||||||||||||||||||||
| if(!pDhcpv6Data->addrAssigned && pDhcpv6Data->prefixAssigned) | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| /* In an IPv6 lease, if only IAPD is received and we never received IANA, | ||||||||||||||||||||||
| * We can use the received IAPD to construct a Ipv6 /128 address which can be used for managerment and voice ... | ||||||||||||||||||||||
| * If we reach this point, only IAPD has been received. Calculate Wan Ipv6 address | ||||||||||||||||||||||
| */ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| CcspTraceInfo(("IANA is not assigned by DHCPV6. Constructing WAN address from the IAPD for Wan Interface \n")); | ||||||||||||||||||||||
| wanmgr_construct_wan_address_from_IAPD(pDhcpv6Data); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
Comment on lines
107
to
117
|
||||||||||||||||||||||
| if(!pDhcpv6Data->addrAssigned && pDhcpv6Data->prefixAssigned) | |
| { | |
| /* In an IPv6 lease, if only IAPD is received and we never received IANA, | |
| * We can use the received IAPD to construct a Ipv6 /128 address which can be used for managerment and voice ... | |
| * If we reach this point, only IAPD has been received. Canculate Wan Ipv6 address | |
| */ | |
| CcspTraceInfo(("IANA is not assigned by DHCPV6. Constructing WAN address from the IAPD for Wan Interface \n")); | |
| wanmgr_construct_wan_address_from_IAPD(pDhcpv6Data); | |
| } |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -59,9 +59,6 @@ | |||||||
| #define POSTD_START_FILE "/tmp/.postd_started" | ||||||||
| #define SELECTED_MODE_TIMEOUT_SECONDS 10 | ||||||||
|
|
||||||||
| #if defined(FEATURE_IPOE_HEALTH_CHECK) && defined(IPOE_HEALTH_CHECK_LAN_SYNC_SUPPORT) | ||||||||
| extern lanState_t lanState; | ||||||||
| #endif | ||||||||
|
|
||||||||
| #if defined(FEATURE_464XLAT) | ||||||||
| typedef enum | ||||||||
|
|
@@ -198,7 +195,7 @@ static ANSC_STATUS WanManager_ClearDHCPData(DML_VIRTUAL_IFACE * pVirtIf); | |||||||
| * lan ipv6 address ready to use. | ||||||||
| * @return RETURN_OK on success else RETURN_ERR | ||||||||
| *************************************************************************************/ | ||||||||
| static int checkIpv6LanAddressIsReadyToUse(DML_VIRTUAL_IFACE* p_VirtIf); | ||||||||
| static int checkIpv6AddressIsReadyToUse(DML_VIRTUAL_IFACE* p_VirtIf); | ||||||||
|
|
||||||||
| #ifdef FEATURE_MAPE | ||||||||
| /************************************************************************************* | ||||||||
|
|
@@ -1035,57 +1032,37 @@ int wan_updateDNS(WanMgr_IfaceSM_Controller_t* pWanIfaceCtrl, BOOL addIPv4, BOOL | |||||||
| return ret; | ||||||||
| } | ||||||||
|
|
||||||||
| /* Check Duplicate Address Detection (DAD) status. The way it works is that | ||||||||
| after an address is added to an interface, the operating system uses the | ||||||||
| Neighbor Discovery Protocol to check if any other host on the network | ||||||||
| has the same address. The whole process will take around 3 to 4 seconds | ||||||||
| to complete. Also we need to check and ensure that the gateway has | ||||||||
| a valid default route entry. | ||||||||
|
|
||||||||
| /** | ||||||||
| * @brief Checks if the IPv6 address is ready to use. | ||||||||
| * | ||||||||
| * This function checks the tentative address, detects Duplicate Address Detection (DAD) failure, and verifies the default route. | ||||||||
| * If DAD fails, it also triggers a Router Solicitation. | ||||||||
| * | ||||||||
| * @param p_VirtIf Pointer to the virtual interface structure. | ||||||||
| * @return int 0 on success, negative value on failure. | ||||||||
| */ | ||||||||
| static int checkIpv6LanAddressIsReadyToUse(DML_VIRTUAL_IFACE* p_VirtIf) | ||||||||
| static int checkIpv6AddressIsReadyToUse(DML_VIRTUAL_IFACE* p_VirtIf) | ||||||||
| { | ||||||||
| char buffer[BUFLEN_256] = {0}; | ||||||||
| FILE *fp_dad = NULL; | ||||||||
| FILE *fp_route = NULL; | ||||||||
| FILE *fp_dad = NULL; | ||||||||
| FILE *fp_route = NULL; | ||||||||
| int dad_flag = 0; | ||||||||
| int route_flag = 0; | ||||||||
| int i; | ||||||||
| char IfaceName[BUFLEN_16] = {0}; | ||||||||
| int BridgeMode = 0; | ||||||||
|
|
||||||||
| { //TODO : temporary debug code to identify the bridgemode sysevent failure issue. | ||||||||
| char Output[BUFLEN_16] = {0}; | ||||||||
| if (sysevent_get(sysevent_fd, sysevent_token, "bridge_mode", Output, sizeof(Output)) !=0) | ||||||||
| { | ||||||||
| CcspTraceError(("%s-%d: bridge_mode sysevent get failed. \n", __FUNCTION__, __LINE__)); | ||||||||
| } | ||||||||
| BridgeMode = atoi(Output); | ||||||||
| CcspTraceInfo(("%s-%d: <<DEBUG>> bridge_mode sysevent value set to =%d \n", __FUNCTION__, __LINE__, BridgeMode)); | ||||||||
| } | ||||||||
| /*TODO: | ||||||||
| *Below Code should be removed once V6 Prefix/IP is assigned on erouter0 Instead of brlan0 for sky Devices. | ||||||||
| */ | ||||||||
| strncpy(IfaceName, ETH_BRIDGE_NAME, sizeof(IfaceName)-1); | ||||||||
| if (WanMgr_isBridgeModeEnabled() == TRUE) | ||||||||
| { | ||||||||
| CcspTraceInfo(("%s-%d: Device is in bridge mode. Assigning IPv6 address on WAN interface.\n", __FUNCTION__, __LINE__)); | ||||||||
| memset(IfaceName, 0, sizeof(IfaceName)); | ||||||||
| strncpy(IfaceName, p_VirtIf->Name, sizeof(IfaceName)-1); | ||||||||
| } | ||||||||
| CcspTraceInfo(("%s-%d: IfaceName=%s, BridgeMode=%d \n", __FUNCTION__, __LINE__, IfaceName, BridgeMode)); | ||||||||
|
|
||||||||
| /* TODO: the below code assumes if the LAN ipv6 address is tentaive for 15 seconds DAD has failed. Do we need additional check? | ||||||||
| * IANA dad is handled in the DHCPv6 client for the Wan Interface. | ||||||||
| * Should we remove the IP from LAN bridge and request a different Delegated prefix? | ||||||||
| * Should we use EUI-64 based Interface identifiers for all platforms? | ||||||||
| */ | ||||||||
| /* Check Duplicate Address Detection (DAD) status. The way it works is that after an address is added to an interface, the operating system uses the | ||||||||
| Neighbor Discovery Protocol to check if any other host on the network has the same address. The whole process will take around 3 to 4 seconds | ||||||||
| to complete. Also we need to check and ensure that the gateway has a valid default route entry. | ||||||||
| */ | ||||||||
| // Note: This check is not strictly necessary and this check could delay the WAN up by 15 seconds in worst case. If the IPv6 address (IANA) is obtained via DHCPv6, and the DHCP client already performs the DAD check. | ||||||||
| // However, it is beneficial to verify that the WAN IPv6 address is auto-calculated from the delegated prefix or via SLAAC. | ||||||||
|
|
||||||||
| for(i=0; i<15; i++) | ||||||||
| for(int i=0; i<15; i++) | ||||||||
| { | ||||||||
| buffer[0] = '\0'; | ||||||||
| if(dad_flag == 0) | ||||||||
| { | ||||||||
| if ((fp_dad = v_secure_popen("r","ip address show dev %s tentative", IfaceName))) | ||||||||
| if ((fp_dad = v_secure_popen("r","ip address show dev %s tentative", p_VirtIf->Name))) | ||||||||
| { | ||||||||
| if(fp_dad != NULL) | ||||||||
| { | ||||||||
|
|
@@ -1098,7 +1075,6 @@ static int checkIpv6LanAddressIsReadyToUse(DML_VIRTUAL_IFACE* p_VirtIf) | |||||||
| } | ||||||||
| } | ||||||||
| } | ||||||||
|
|
||||||||
| if(dad_flag == 0) | ||||||||
| { | ||||||||
| sleep(1); | ||||||||
|
|
@@ -1122,10 +1098,10 @@ static int checkIpv6LanAddressIsReadyToUse(DML_VIRTUAL_IFACE* p_VirtIf) | |||||||
| } | ||||||||
| } | ||||||||
|
|
||||||||
| //if DAD failed on LAN bridge, log an ERROR message and continue with the WAN process. | ||||||||
| //if DAD failed on WAN interface, log an ERROR message and continue with the WAN process. | ||||||||
| if(dad_flag == 0 || route_flag == 0) | ||||||||
| { | ||||||||
| CcspTraceError(("%s %d dad_flag[%d] route_flag[%d] Failed \n", __FUNCTION__, __LINE__,dad_flag,route_flag)); | ||||||||
| CcspTraceError(("%s %d dad_flag[%s] route_flag[%s] Failed \n", __FUNCTION__, __LINE__, dad_flag ? "SUCCESS" : "FAILED", route_flag ? "SUCCESS" : "FAILED")); | ||||||||
| } | ||||||||
|
|
||||||||
| if(route_flag == 0) | ||||||||
|
|
@@ -1627,8 +1603,9 @@ static int wan_tearDownIPv6(WanMgr_IfaceSM_Controller_t * pWanIfaceCtrl) | |||||||
| } | ||||||||
| } | ||||||||
| #endif | ||||||||
|
|
||||||||
| /** Unconfig IPv6. */ | ||||||||
| if ( WanManager_Ipv6PrefixUtil(p_VirtIf->Name, DEL_ADDR,0,0) < 0) | ||||||||
| if ( WanManager_Ipv6AddrUtil(p_VirtIf, DEL_ADDR) < 0) | ||||||||
| { | ||||||||
| AnscTraceError(("%s %d - Failed to remove inactive address \n", __FUNCTION__,__LINE__)); | ||||||||
| } | ||||||||
|
|
@@ -1661,6 +1638,7 @@ static int wan_tearDownIPv6(WanMgr_IfaceSM_Controller_t * pWanIfaceCtrl) | |||||||
| sysevent_set(sysevent_fd, sysevent_token, SYSEVENT_FIREWALL_RESTART, NULL, 0); | ||||||||
|
|
||||||||
| //RBUS_WAN_IP | ||||||||
| //TODO : **************************** Check this ************************ | ||||||||
|
||||||||
| //TODO : **************************** Check this ************************ | |
| // TODO: Verify that the RBUS_WAN_IP IPv6 sysevent keys cleared below are correct for all product variants when WAN IPv6 goes down. |
Copilot
AI
Feb 23, 2026
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.
The added //TODO : **************************** Check this ************************ is a placeholder and doesn’t describe an actionable task. Please replace it with a specific TODO (what/why) and ideally a ticket reference, or remove it if not needed.
| //TODO : **************************** Check this ************************ |
Copilot
AI
Jan 20, 2026
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.
Comment lacks proper spacing. Should be '// Disable accept_ra' with space after '//'.
| //Disable accept_ra | |
| // Disable accept_ra |
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.
wanmgr_dhcp_event_handler.ccallswanmgr_construct_wan_address_from_IAPD()but does not include the header that declares it (wanmgr_dhcpv6_apis.h). This will rely on an implicit declaration in some toolchains (or fail to compile under C99/C11 with-Werror=implicit-function-declaration). Please include the proper header or add a forward declaration.