RDKB-62645 : Observing IPv6 prefix delegation issues#173
Conversation
Reason for change: Fixing Prefix length issue for the for platforms that support prefix delegation to LAN clients. Test Procedure: Dibbler server should have pd-class if enabled. Risks: none Priority: P1 Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
There was a problem hiding this comment.
Pull request overview
This PR fixes IPv6 prefix delegation issues for platforms supporting prefix delegation to LAN clients by using the delegated prefix length directly instead of hardcoding "/64".
Key Changes:
- Adds conditional compilation blocks for
CISCO_CONFIG_DHCPV6_PREFIX_DELEGATIONto override the hardcoded "/64" prefix length - Ensures the delegated prefix length from
pVirtIf->IP.Ipv6Data.sitePrefixis used when the feature is enabled
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) | ||
| /* Use the delegated prefix length directly for platforms that support prefix delegation to LAN clients */ | ||
| strncpy(prefix, pVirtIf->IP.Ipv6Data.sitePrefix, sizeof(prefix) - 1); | ||
| #else |
There was a problem hiding this comment.
Missing null termination after strncpy. If pVirtIf->IP.Ipv6Data.sitePrefix is exactly sizeof(prefix) or longer, the resulting string may not be null-terminated. Add explicit null termination: prefix[sizeof(prefix) - 1] = '\0';
| #else |
| strncat(prefix, "/64",sizeof(prefix)-1); | ||
| #if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) | ||
| /* Use the delegated prefix length directly for platforms that support prefix delegation to LAN clients */ | ||
| strncpy(prefix, pVirtIf->IP.Ipv6Data.sitePrefix, sizeof(prefix) - 1); |
There was a problem hiding this comment.
Missing null termination after strncpy. If pVirtIf->IP.Ipv6Data.sitePrefix is exactly sizeof(prefix) or longer, the resulting string may not be null-terminated. Add explicit null termination: prefix[sizeof(prefix) - 1] = '\0';
| strncpy(prefix, pVirtIf->IP.Ipv6Data.sitePrefix, sizeof(prefix) - 1); | |
| strncpy(prefix, pVirtIf->IP.Ipv6Data.sitePrefix, sizeof(prefix) - 1); | |
| prefix[sizeof(prefix) - 1] = '\0'; |
Reason for change: Fixing Prefix length issue for the for platforms that support prefix delegation to LAN clients.
Test Procedure:
Dibbler server should have pd-class if enabled.
Risks: none
Priority: P1