[dhcp6relay] Add VRF support for upstream sockets (VLAN vrf and server_vrf) - #117
Open
AnantKishorSharma wants to merge 3 commits into
Open
[dhcp6relay] Add VRF support for upstream sockets (VLAN vrf and server_vrf)#117AnantKishorSharma wants to merge 3 commits into
AnantKishorSharma wants to merge 3 commits into
Conversation
…restart dhcp6relay read DHCP_RELAY once at startup and required a dhcp_relay container restart for any relay config change. Apply changes at runtime instead: a detached monitor thread watches CONFIG_DB/STATE_DB and the libevent main thread reconciles the live config. Signed-off-by: Anant Kishor Sharma <anant.kishor-sharma@hpe.com>
…r_vrf) Bind the server-facing socket to the VLAN's VRF or an explicit server_vrf via SO_BINDTODEVICE, and release shared server-VRF sockets on last use. Fixes sonic-net#89. Signed-off-by: Anant Kishor Sharma <anant.kishor-sharma@hpe.com>
Author
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This was referenced Jun 30, 2026
Collaborator
|
Hi, there are workflow run(s) waiting for approval, you may be first-time contributor. I will notify maintainers to help approve once PR is approved. Thanks! ---Powered by SONiC BuildBot
|
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
…to avoid a shutdown race Signed-off-by: Anant Kishor Sharma <anant.kishor-sharma@hpe.com>
AnantKishorSharma
force-pushed
the
dhcp6relay-vrf-support
branch
from
July 24, 2026 10:51
715a737 to
1ce0974
Compare
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why I did it
dhcp6relayalways sent relay-forward to the DHCPv6 servers through the global routing table, so it could not reach servers that live in a non-default VRF. Fixes #89.How I did it
Bind the upstream (server-facing) socket to a VRF via
SO_BINDTODEVICE:VLAN_INTERFACEvrf_name): the per-VLAN upstream socket is bound to that VRF.server_vrfon theDHCP_RELAYrow (servers reachable in a VRF different from the VLAN's): a shared per-VRF upstream socket is opened, demultiplexed back to the owning VLAN by link-address. The shared socket is released once the last VLAN referencing it is removed/re-pointed, so a deleted/recreated server VRF leaves no stale socket behind.All applied at runtime through the existing reconcile path — no container restart. A runtime VRF change tears the relay down and re-arms it —
SO_BINDTODEVICEcannot be rebound in place, so the upstream sockets are recreated under the new VRF.How to verify it
make test), including new coverage for the server-VRF socket lifecycle.