[isc-dhcp-relay] Patch to allow DHCP relay agent to discover interfaces even if they are down#3851
Merged
lguohan merged 1 commit intosonic-net:masterfrom Dec 7, 2019
jleveque:fix_dhcp_relay
Merged
[isc-dhcp-relay] Patch to allow DHCP relay agent to discover interfaces even if they are down#3851lguohan merged 1 commit intosonic-net:masterfrom jleveque:fix_dhcp_relay
lguohan merged 1 commit intosonic-net:masterfrom
jleveque:fix_dhcp_relay
Conversation
Collaborator
|
please describe the test you have done |
Contributor
Author
|
Testing instructions added to PR description. |
Contributor
Author
|
Retest vsimage please |
lguohan
approved these changes
Dec 7, 2019
This was referenced Dec 7, 2019
abdosi
pushed a commit
that referenced
this pull request
Jan 3, 2020
…3851) Patch isc-dhcp-relay in order to allow the relay agent to discover configured interfaces even if they are down. Without this patch, the relay agent will not discover configured interfaces if they are down when the relay agent starts up. If the interface(s) then get brought up after the relay started, the relay will discard packets received on these interfaces and log the message, Discarding packet received on <iface_name> interface that has no IPv4 address assigned. This led to race conditions when starting SONiC (or loading configuration). To resolve this, the relay agent would need to be restarted with all configured interfaces up. With this patch, the relay agent will discover all configured interfaces, whether or not they are up at the time the relay agent starts. Thus, the state of the configured interfaces can be down when the relay agent starts and brought up during the lifetime of the relay agent process, and the relay agent will relay packets as expected; it will not discard them.
patrickmacarthur
pushed a commit
to patrickmacarthur/sonic-buildimage
that referenced
this pull request
Aug 6, 2025
…AD automatically (sonic-net#998) #### Why I did it src/sonic-utilities ``` * 2c35fdf2 - (HEAD -> 202405, origin/202405) Merge pull request sonic-net#164 from mssonicbld/sonicbld/202405-merge (21 hours ago) [mssonicbld] * 307d9491 - Merge branch '202405' of https://github.com/sonic-net/sonic-utilities into 202405 (23 hours ago) [Sonic Automation] * 2dc0be8d - [Arista] Add Arista-7050CX3-32S-C28S4 to generic_config_updater (sonic-net#3851) (30 hours ago) [mssonicbld] ``` #### How I did it #### How to verify it #### Description for the changelog
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.
- What I did
Patch isc-dhcp-relay in order to allow the relay agent to discover configured interfaces even if they are down.
Without this patch, the relay agent will not discover configured interfaces if they are down when the relay agent starts up. If the interface(s) then get brought up after the relay started, the relay will discard packets received on these interfaces and log the message,
Discarding packet received on <iface_name> interface that has no IPv4 address assigned.This led to race conditions when starting SONiC (or loading configuration). To resolve this, the relay agent would need to be restarted with all configured interfaces up.With this patch, the relay agent will discover all configured interfaces, whether or not they are up at the time the relay agent starts. Thus, the state of the configured interfaces can be down when the relay agent starts and brought up during the lifetime of the relay agent process, and the relay agent will relay packets as expected; it will not discard them.
- How to verify it
systemctl stop dhcp_relay.service)systemctl start dhcp_relay.service). Wait for the container to spawn the dhcrelay process(es).tcpdump -ne -i <iface_name> port 67 or 68or similar command)b. Craft and send DHCP Discover or Request packet to the switch on the downlink (the DHCP relay test in the sonic-mgmt repo can be helpful here)
c. Check packet capture to confirm the packet was relayed to all configured destination IP addresses on each configured uplink interface
d. Craft and send DHCP Offer or Ack packet in on each uplink (again, the DHCP relay test in the sonic-mgmt repo can be helpful here)
e. Check packet capture to confirm the packet was relayed to all configured destination IP addresses on each configured uplink interface
f. Check /var/log/syslog to ensure that no
Discarding packet received on <iface_name> interface that has no IPv4 address assigned.messages were loggedsystemctl stop dhcp_relay.service)systemctl start dhcp_relay.service). Wait for the container to spawn the dhcrelay process(es).systemctl stop dhcp_relay.service)systemctl start dhcp_relay.service). Wait for the container to spawn the dhcrelay process(es).a. Bring down the interface on the switch, wait for a few seconds, then bring the interface back up
b. Repeat step 4
a. Bring down the connected interface on the neighboring switch, wait for a few seconds, then bring the interface on the neighboring switch back up
b. Repeat step 4