-
Notifications
You must be signed in to change notification settings - Fork 28
ip,ip6,frr: flush routes like zebra on address and iface teardown #710
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
base: main
Are you sure you want to change the base?
Changes from all commits
8d271b4
d910cfd
8a1a65c
1ab297c
183e2c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -323,6 +323,31 @@ static void iface_metrics_collect(struct metrics_writer *w) { | |||||
| } | ||||||
| } | ||||||
|
|
||||||
| static struct gr_iface_config iface_config; | ||||||
|
|
||||||
| const struct gr_iface_config *iface_config_get(void) { | ||||||
| return &iface_config; | ||||||
| } | ||||||
|
|
||||||
| static struct api_out config_get(const void *, struct api_ctx *) { | ||||||
| struct gr_iface_config_get_resp *resp = calloc(1, sizeof(*resp)); | ||||||
| if (resp == NULL) | ||||||
| return api_out(ENOMEM, 0, NULL); | ||||||
| resp->base = iface_config; | ||||||
| return api_out(0, sizeof(*resp), resp); | ||||||
| } | ||||||
|
|
||||||
| static struct api_out config_set(const void *request, struct api_ctx *) { | ||||||
| const struct gr_iface_config_set_req *req = request; | ||||||
|
|
||||||
| if (req->set_attrs & GR_IFACE_CONFIG_SET_FLUSH_ROUTES) | ||||||
| iface_config.flush_routes_on_down = req->flush_routes_on_down; | ||||||
| if (req->set_attrs & GR_IFACE_CONFIG_SET_SKIP_EVENTS) | ||||||
| iface_config.skip_route_events_on_iface_down = req->skip_route_events_on_iface_down; | ||||||
|
Comment on lines
+342
to
+346
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of a private struct iface_config, could you add bool fields to gr_config: Lines 26 to 27 in b1e59af
This way, the object is visible globally via Also, add env vars to tune these settings on startup (in addition to the API messages for the frr plugin). |
||||||
|
|
||||||
| return api_out(0, 0, NULL); | ||||||
| } | ||||||
|
|
||||||
| static struct metrics_collector iface_collector = { | ||||||
| .name = "iface", | ||||||
| .collect = iface_metrics_collect, | ||||||
|
|
@@ -338,6 +363,8 @@ RTE_INIT(infra_api_init) { | |||||
| api_handler(GR_IFACE_MAC_LIST, iface_mac_list); | ||||||
| api_handler(GR_IFACE_MAC_SET, iface_mac_set); | ||||||
| api_handler(GR_IFACE_SET, iface_set); | ||||||
| api_handler(GR_IFACE_CONFIG_GET, config_get); | ||||||
| api_handler(GR_IFACE_CONFIG_SET, config_set); | ||||||
| event_serializer(GR_EVENT_IFACE_ADD, iface_event_serialize); | ||||||
| event_serializer(GR_EVENT_IFACE_POST_ADD, iface_event_serialize); | ||||||
| event_serializer(GR_EVENT_IFACE_PRE_REMOVE, iface_event_serialize); | ||||||
|
|
||||||
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.
Why not use grout_client_send_recv()?
It already logs errors.