Skip to content

[201811][dhcp_relay] Properly wait for routed interfaces to be ready before starting relay agent#3442

Merged
jleveque merged 2 commits intosonic-net:201811from
jleveque:fix_dhcp_relay_wait_for_intf_201811
Sep 12, 2019
Merged

[201811][dhcp_relay] Properly wait for routed interfaces to be ready before starting relay agent#3442
jleveque merged 2 commits intosonic-net:201811from
jleveque:fix_dhcp_relay_wait_for_intf_201811

Conversation

@jleveque
Copy link
Copy Markdown
Contributor

@jleveque jleveque commented Sep 11, 2019

- What I did

Previous solution wouldn't necessarily wait until interfaces were completely up and configured with an IP address. This solution checks the INTERFACE_TABLE in STATE_DB, which should only report "ok" if the interface is completely up and ready.

Also enhanced the code to only wait for interfaces with an IPv4 address configured, as the DHCP relay agent currently only support IPv4.

This is a port of #3441 for the 201811 branch.

@jleveque jleveque merged commit 92d359d into sonic-net:201811 Sep 12, 2019
@jleveque jleveque deleted the fix_dhcp_relay_wait_for_intf_201811 branch September 12, 2019 17:57
@santoshdoke
Copy link
Copy Markdown

santoshdoke commented Sep 12, 2019 via email

@jleveque
Copy link
Copy Markdown
Contributor Author

@santoshdoke: Yes. The problem seen is that the DHCP relay agent was failing to relay DHCP packets. This was caused because the relay agent would open sockets to the configured interfaces before they were fully up and had IP addresses assigned. Restarting the DHCP relay container once all interfaces are fully up and configured properly would resolve the issue. This fix ensures the agent doesn't start until all configured interfaces are truly up and ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants