Skip to content

[dhcp_device]: Tolerate multiple IPv6 link-local addresses on interface#79

Open
Bojun-Feng wants to merge 2 commits into
sonic-net:masterfrom
Bojun-Feng:bug/fix-multi-ipv6-lla-exit
Open

[dhcp_device]: Tolerate multiple IPv6 link-local addresses on interface#79
Bojun-Feng wants to merge 2 commits into
sonic-net:masterfrom
Bojun-Feng:bug/fix-multi-ipv6-lla-exit

Conversation

@Bojun-Feng
Copy link
Copy Markdown

Why I did it

Fix sonic-net/sonic-buildimage#27586

After #62, dhcpmon exits during startup when the management interface has more than one IPv6 link-local address. This is a valid Linux networking configuration (e.g., both a kernel EUI-64 LLA and a statically configured management LLA coexist on eth0). The strict equality check causes dhcpmon to treat this as fatal, breaking DHCP relay health monitoring and blocking sonic-mgmt dhcpv4 relay tests.

How I did it

  • Relaxed the validation condition from requiring exactly 1 LLA to requiring at least 1 LLA (or GUA)
  • Stored only the first discovered LLA for packet identification, logging all subsequent LLAs

How to verify it

  1. Add a second IPv6 link-local address to eth0: ip -6 addr add fe80::dead:beef:1/64 dev eth0 scope link
  2. Restart the dhcp_relay container and verify dhcpmon starts successfully: docker exec dhcp_relay supervisorctl status dhcpmon-Vlan1000
  3. Confirm the first LLA is used for relay identification in syslog

Description for the changelog

Fixed dhcpmon crash on interfaces with multiple IPv6 link-local addresses by tolerating any number of LLAs and using the first one found.

* Allow interfaces with more than one LLA to pass initialization
* Store only the first discovered LLA for packet identification

Signed-off-by: Bojun-Feng <bojundf@gmail.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@tirupatihemanth
Copy link
Copy Markdown

@Xichen96 to review. Was it intentional not to allow multiple LLA in your original PR? #62

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

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.

Bug: dhcpmon exits when eth0 management interface has multiple IPv6 LLAs

3 participants