-
Notifications
You must be signed in to change notification settings - Fork 12
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
confd: Enable config for lldp tx interval #882
base: main
Are you sure you want to change the base?
Conversation
5996edf
to
16c70ba
Compare
16c70ba
to
7de414b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work so far!
This change introduces the configuration of the tx-interval parameter for the LLDP service, allowing control over the frequency of LLDP hello messages. By reducing the tx-interval, the waiting time for LLDP packets during tests is significantly shortened. This improvement eliminates the need to toggle the interface down and up to force the emission of LLDP packets in the test environment.
7de414b
to
57c8031
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one final comment, nice work!
if (systemf("initctl -nbq restart lldpd")) { | ||
ERROR("Failed to restart lldpd"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not use restart
here, we want to "roll in" the next generation at the same time via finit's initctl reload
mechanism. The reason for this is simply that changes we add to the /etc/lldpd.d/*.conf
may include references to interfaces that have not been created yet. So, instead of restart, use initctl -nbq touch ...
construct, used for other services in this file, to mark it for restarting by Finit.
Now, previously we thought lldpd
reconfigured itself automatically on SIGHUP, but that does not seem to be the case. To ensure Finit does not send SIGHUP, but instead performs the actual process restart (stop + start) for us, we need to change the .conf snippet in package/skeleton-init-finit/skeleton/etc/finit.d/available/lldpd.conf
.
From
service [2345] env:-/etc/default/lldpd lldpd -d $LLDPD_ARGS -- LLDP daemon (IEEE 802.1ab)
to:
service <!> env:-/etc/default/lldpd \
[2345] lldpd -d $LLDPD_ARGS -- LLDP daemon (IEEE 802.1ab)
The <!>
construct tells Finit this service does not support SIGHUP.
To test this, without rebuilding from distclean, you need to perform a make skeleton-init-finit-rebuild
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clear as a tear!
This change introduces the configuration of the tx-interval parameter for the LLDP service, allowing control over the frequency of LLDP hello messages. By reducing the tx-interval, the waiting time for LLDP packets during tests is significantly shortened. This improvement eliminates the need to toggle the interface down and up to force the emission of LLDP packets.
Checklist
Tick relevant boxes, this PR is-a or has-a: