-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[Functional] [dhcp6relay] Relay Reply was sent on a different Vlan from where it was initated #13077
Comments
When a single interface add to multiple VLAN groups, in the first VLAN group it will be untagged interface, in the second VLAN and third VLAN group it will be marked as tagged interface. So solution may like:
|
I don't understand,
Can't the iface be tagged in all VLAN Groups.
Afaik, the kernel strips off the Vlan TAG. if we can get this info from the packet, then this should solve the problem.
|
Yes, it can. What I mentioned here is mainly about mixed case, the point is interface vlan map only for untagged interface. For kernel strips off vlan, when the packet reaches vlan member interface raw socket, I think the vlan header is not removed yet. |
originator agreed on the explanation and can close it now... |
Still an issue, just not a usecase that is used currently. I think it's better to keep this open for documentation. |
Description
Happens when the client is a member of multiple Vlans i.e. a trunk VLAN
Steps to reproduce the issue:
topology : enp4s0f0 (host) <-> Ethernet0 (DUT)
Setup dhcp server, add dhcp_relay config and restart dhcp_relay service
dhclient -6 enp66s0f1.690 -v
Describe the results you received:
Reply was received on Vlan691
Describe the results you expected:
Reply should be received on the same vlan
Triage:
Can be traced back to this sonic-net/sonic-dhcp-relay#27 . This change assumes a 1<->1 mapping b/w member interfaes and vlan and there-in lies the problem
Potential Fix:
As described in the PR, the dhcp6relay client socket receives 3 copies of the same packet for every dhcpv6 related packet sent by the client (One for Member iface. one for bridge and one for Vlan). And the code only operates on the one recieved by Member Iface (Understandable since this is required to check if the iface is the standy leg of DualTor) and doesn't care about the other two
The agent maintains a 1<->1 mappig b/w ifaces and Vlan to infer the Vlan which the packet was received on and it causes the problem.
Drop the copy on Bridge
Hash the packet contents when the if_index is either Vlan or member iface. Save the hash <-> (vlan, member) mapping in a buffer and use this info to infer the vlan <-> iface mapping (Only do this for Dual Tor, in normal cases we don't need the Vlan <-> iface mapping, so proceed with relaying the client msg after seeing it on Vlan netdev)
Instead of Hashing the entire packet, the possibility of using xid can be checked.
The text was updated successfully, but these errors were encountered: