Skip to content

Fix issue 23323 ipv6 subinterface#25538

Closed
Sumalatha-G-ML wants to merge 1 commit intosonic-net:masterfrom
Sumalatha-G-ML:fix-issue-23323-ipv6-subinterface
Closed

Fix issue 23323 ipv6 subinterface#25538
Sumalatha-G-ML wants to merge 1 commit intosonic-net:masterfrom
Sumalatha-G-ML:fix-issue-23323-ipv6-subinterface

Conversation

@Sumalatha-G-ML
Copy link
Copy Markdown

@Sumalatha-G-ML Sumalatha-G-ML commented Feb 17, 2026

Why I did it
Fix for issue #23323 - The sonic-cli command show interface Ethernet throws a jinja2.exceptions.UndefinedError exception when IPv6 is disabled on a subinterface.

Root Cause: The Jinja2 template show_interface.j2 (line 80) doesn't check if the addresses field exists before accessing it. When IPv6 is disabled, the openconfig-if-ip:ipv6 object doesn't contain an addresses field, causing the exception.

Work item tracking
Microsoft ADO (number only):

How I did it
Updated the sonic-mgmt-framework submodule to include the fix that adds a conditional check for the addresses field in the show_interface.j2 template.

Change in sonic-mgmt-framework:

File: CLI/renderer/templates/show_interface.j2 (line 79)
Before: {% if subif["openconfig-if-ip:ipv6"] %}
After: {% if subif["openconfig-if-ip:ipv6"] and "addresses" in subif["openconfig-if-ip:ipv6"] %}
This ensures the template only attempts to access the addresses field when it exists.

How to verify it
Configure a subinterface with IPv6 disabled
Run sonic-cli command: show interface Ethernet
Verify the command executes without throwing jinja2.exceptions.UndefinedError
Verify the interface information is displayed correctly
Test scenarios:

✅ IPv6 disabled (no addresses field) - should work without errors
✅ IPv6 enabled (with addresses field) - should work as before
Which release branch to backport (provide reason below if selected)
202305
202311
202405
202411
202505
202511
Tested branch (Please provide the tested image version)
Branch: fix-issue-23323-ipv6-subinterface
Submodule commit: b927e10551318d389fe8a7f68f33aee59e9f0f7c
Description for the changelog
Fix Jinja2 template error in show interface Ethernet command when IPv6 is disabled on subinterface

Link to config_db schema for YANG module changes
N/A - No config_db schema changes

A picture of a cute animal (not mandatory but encouraged)
🐛 → ✅

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@Sumalatha-G-ML Sumalatha-G-ML force-pushed the fix-issue-23323-ipv6-subinterface branch from 7d79ace to 5b37fac Compare February 27, 2026 07:06
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@Sumalatha-G-ML Sumalatha-G-ML force-pushed the fix-issue-23323-ipv6-subinterface branch from 5b37fac to 09412db Compare February 27, 2026 07:45
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Fix for IPv6 disabled subinterface exception in 'show interface Ethernet' command.

Changes:
- Updated sonic-mgmt-framework submodule to include fix for issue sonic-net#23323
- Added conditional check for 'addresses' field in show_interface.j2 template
- Prevents jinja2.exceptions.UndefinedError when IPv6 is disabled

Fixes: sonic-net#23323
Signed-off-by: Sumalatha G <sumalatha.g@xoriant.com>
@Sumalatha-G-ML Sumalatha-G-ML force-pushed the fix-issue-23323-ipv6-subinterface branch from 09412db to f67cd12 Compare February 27, 2026 07:57
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@Sumalatha-G-ML
Copy link
Copy Markdown
Author

Opened a PR in sonic-net/sonic-mgmt-framework repo so closing it.

@Sumalatha-G-ML Sumalatha-G-ML deleted the fix-issue-23323-ipv6-subinterface branch March 2, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants