-
Notifications
You must be signed in to change notification settings - Fork 529
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
Changes to read route tag value from Netlink Message and take appropriate action #3353
base: master
Are you sure you want to change the base?
Conversation
routesync.cpp. In routesyncd we read tag from constants.yml and take action of not to send route to appdb and also fallback to default route. Signed-off-by: Abhishek Dosi <[email protected]>
@prsunny : can you help review this. |
catch (const exception &e) | ||
{ | ||
cout << "Exception \"" << e.what() << "\" had been thrown in daemon in loading constants.yml" << endl; | ||
route_tag_not_to_appdb = 0; |
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.
Non T2 devices might always print the exception log?
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 if fails to reads constants.yml which should not happen. this attribute are define in constants.yml (irrespective of the role)
https://github.com/sonic-net/sonic-buildimage/pull/20224/files#diff-e6f2fe13a6c276dc2f3b27a5bef79886f9c103194be4fcb28ce57375edf2c23c
@@ -693,6 +710,13 @@ void RouteSync::onRouteMsg(int nlmsg_type, struct nl_object *obj, char *vrf) | |||
destipprefix[strlen(vrf)] = ':'; | |||
} | |||
|
|||
tag = rtnl_route_get_priority(route_obj); | |||
|
|||
if (tag == route_tag_not_to_appdb) |
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.
As I understand on pizza box, route_tag_not_to_appdb
is zero. If for any route the priority is zero then route will not be added to app_db. So the route will always has non-zero priority?
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.
it should not be zero. It always reads form constants.yml. Only time this will be zero in case of fail condition of loading/reading the file.
if (tag == route_tag_not_to_appdb) | ||
return; | ||
else if (tag == route_tag_fallback_to_default_route) | ||
route_eligible_for_fallback_to_default_route = true; |
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.
nit: indentation is wrong
What I did:
Added support to compile and load code to read yaml file in
routesync.cpp. In routesyncd we read tag from constants.yml and take action
of not to send route to appdb and also fallback to default route.
Why I did:
Corresponding PR on FRR : sonic-net/sonic-buildimage#20692 to send route tag to fpmsyncd.
PR to specify constants.yml tag value: sonic-net/sonic-buildimage#20224
PR for installing libyaml package: sonic-net/sonic-buildimage#20698