Skip to content
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

[RFC] add support for reset command #228

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

cbrasho
Copy link

@cbrasho cbrasho commented Apr 12, 2017

this is in response to #153
not sure if calling lldpd_cleanup(cfg) in daemon/client.c is enough to reset the configuration.

@@ -438,7 +474,6 @@ main(int argc, char *argv[])
ctlname = lldpctl_get_default_transport();

signal(SIGHUP, SIG_IGN);

Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: extra whitespace

@cbrasho cbrasho changed the title Issue153 [RFC] add support for reset command Apr 12, 2017
@vincentbernat
Copy link
Member

Also needed (but I can do it after merging):

  • update the manual page with the new command
  • add an integration test

config->c_reset == 1) {
log_debug("rpc", "client asked to reset lldpd's config");
cfg->g_config.c_reset = 1; //mark that reset is being processed by daemon
//so that client won't accept any new reset
Copy link
Member

Choose a reason for hiding this comment

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

You don't really need an "in progress" marker. lldpd is totally "evented", so nothing will execute in parallel until the end of this function. So, nobody will be able to observer a case where cfg->g_onfig.c_reset == 1. You can remove that and some other code on the client side about that.

Copy link
Member

@vincentbernat vincentbernat left a comment

Choose a reason for hiding this comment

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

Sorry for the very late answer. We don't get a notification when new commits are pushed, so I just forgot about this PR!

if (lldpctl_atom_get_int(config, lldpctl_k_config_reset) == 1) {
log_debug("lldpctl", "lldpd already has a reset config request in it's queue. Please try later.");
lldpctl_atom_dec_ref(config);
return 1;
Copy link
Member

Choose a reason for hiding this comment

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

This is an impossible case. No client can never get a value of 1 at this point.

@@ -793,6 +793,7 @@ typedef enum {
lldpctl_k_custom_tlv_oui_subtype, /**< `(I,WO)` custom TLV subtype. Default is 0 (1 byte) */
lldpctl_k_custom_tlv_oui_info_string, /**< `(I,WO)` custom TLV Organizationally Unique Identifier Information String (up to 507 bytes) */
lldpctl_k_custom_tlv_op, /**< `(I,WO)` custom TLV operation */
lldpctl_k_config_reset, /**< `(I)` lldpd is reset */
Copy link
Member

Choose a reason for hiding this comment

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

This is (I,WO). Also, small nitpick, uses some tabs to align it with the other comments.

lldpctl_atom_dec_ref(config);
return 1;
}

Copy link
Member

Choose a reason for hiding this comment

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

This whole function should use tabs instead of spaces for indentation.

@cbrasho
Copy link
Author

cbrasho commented May 4, 2017 via email

@commodo
Copy link
Contributor

commodo commented Jun 2, 2020

So, an update from my side.

This would probably need to be picked up by someone else; and probably re-designed.
What happened is: I left Riverbed around December 2017.
Up until then, I tried to delegate this task [since I had my hands full with other work].
@cbrasho also left Riverbed some-time after I did.

I don't know if there is direct interest [within Riverbed] to continue this. Probably other stuff is more important.

This can be left as-is [from my side] as a reference-point.
Or, if it's superseded by something else, this can be closed.
I probably should have mentioned this stuff earlier, but forgot.
Github doesn't show too much recent activity [I guess].

Thanks
Alex

@vincentbernat
Copy link
Member

We can keep it open. I don't mind having opened PR. This is easier to find than a closed PR. I have also very little time and have some other issues to handle before this. So, let's not make promises here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants