[201811][isc-dhcp-relay] Patch to allow DHCP relay agent to discover interfaces even if they are down#3852
Merged
lguohan merged 1 commit intosonic-net:201811from Dec 7, 2019
jleveque:fix_dhcp_relay_201811
Merged
[201811][isc-dhcp-relay] Patch to allow DHCP relay agent to discover interfaces even if they are down#3852lguohan merged 1 commit intosonic-net:201811from jleveque:fix_dhcp_relay_201811
lguohan merged 1 commit intosonic-net:201811from
jleveque:fix_dhcp_relay_201811
Conversation
…n if they are down
lguohan
approved these changes
Dec 7, 2019
This was referenced Dec 7, 2019
mssonicbld
added a commit
that referenced
this pull request
Apr 18, 2025
…atically (#22340) #### Why I did it src/sonic-utilities ``` * ed1ab68 - (HEAD -> master, origin/master, origin/HEAD) Add Nokia platforms to GCU validator (#3800) (12 hours ago) [Dylan Godwin] * 4035df3 - [Mellanox] Support Mellanox Spectrum5 ASIC in generic configuration update (#3852) (12 hours ago) [DavidZagury] * 36b18ec - [SRv6] add support for SRv6 counters (#3841) (2 days ago) [Yakiv Huryk] ``` #### 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.
This PR backports #3851 to the 201811 branch.
- 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