Skip to content

dhcp for dual tor: include all vlan intf into downstream intf#6990

Merged
2 commits merged intosonic-net:masterfrom
trzhang11:dhcp-dt
Mar 10, 2021
Merged

dhcp for dual tor: include all vlan intf into downstream intf#6990
2 commits merged intosonic-net:masterfrom
trzhang11:dhcp-dt

Conversation

@ghost
Copy link

@ghost ghost commented Mar 8, 2021

Include all vlan interfaces into downstream interface set to allow each dhcp instance to scan over them. Note that with this change, downstream interface set includes not only vlan interfaces but also portchannels. However, this doesn't matter as dhcp uses giaddr or yiaddr to choose out interface.

Tested and verified on a virtual testbed.

@ghost ghost requested a review from lguohan as a code owner March 8, 2021 21:25
@ghost ghost added the DHCP Relay label Mar 8, 2021
@ghost ghost requested review from jleveque and tahmed-dev March 8, 2021 21:26
(flags & INTERFACE_DOWNSTREAM ? 'Y' : 'N'));

+ if (flags & INTERFACE_DOWNSTREAM) {
+ if (flags & INTERFACE_DOWNSTREAM || flags & INTERFACE_UPSTREAM) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use the existing interfaces which hold list of all interfaces as being done in isc dhcrelay:849

Copy link
Author

@ghost ghost Mar 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a) the code above is better: we don't have to include all interfaces, -id will include vlan for this proc, and -iu will include other vlans on the switch; b) the code above is safer: no one knows if some interfaces will have any setting errors by the code, for example, in patch 0010, I already find out that netmask is not correctly setup. So in short, we should keep the list as short as possible

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, however on the other hand, this is a legacy code and reducing the amount of code changes helps limit regression or injecting new bugs given that the code was running for quite some time and functioning. I am indifferent though as it is not a complex change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without comment, it is a bit confusing why we are including upstream interfaces in the downstream interface list. Maybe consider adding a comment.

Copy link
Author

@ghost ghost Mar 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, but I will add a comment in the same line so that we don't have to re-generate the patch

tahmed-dev
tahmed-dev previously approved these changes Mar 9, 2021
@ghost ghost merged commit 4e4f76c into sonic-net:master Mar 10, 2021
lguohan pushed a commit that referenced this pull request Mar 10, 2021
* include all vlan intf into downstream intf

* add a comment
@ghost ghost deleted the dhcp-dt branch March 12, 2021 22:21
raphaelt-nvidia pushed a commit to raphaelt-nvidia/sonic-buildimage that referenced this pull request May 23, 2021
…net#6990)

* include all vlan intf into downstream intf

* add a comment
carl-nokia pushed a commit to carl-nokia/sonic-buildimage that referenced this pull request Aug 7, 2021
…net#6990)

* include all vlan intf into downstream intf

* add a comment
This pull request was closed.
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