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

Eos routes wrong nexthopIps for protocol=connected entries #943

Merged
merged 1 commit into from
May 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions suzieq/poller/worker/services/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ def _clean_eos_data(self, processed_data, _):
entry['oifs'] = len(entry['nexthopIps']) * \
['_nexthopVrf:default']
entry['protocol'] = entry['protocol'].lower()
if entry['protocol'] == 'connected':
Copy link
Collaborator

Choose a reason for hiding this comment

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

In the commit you are saying that you should do this change only when 0.0.0.0 as nexthopIps. Here you are always updating it (hence you are not checking if nexthopIps == '0.0.0.0'. Is it the right thing to do?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the point is that the nexthopIps list should be always empty if the protocol is connected. That was just an explanation of the bug, there are some cases where we put 0.0.0.0 as nexthopIps even if the protocol is connected, so here we just set nexthopIps as empty every time we have protocol=connected , it doesn't metter checking if nexthopIps is equal to 0.0.0.0 or not.

entry['nexthopIps'] = []
entry['preference'] = int(entry.get('preference', 0))
entry['metric'] = int(entry.get('metric', 0))
self._fix_ipvers(entry)
Expand Down
Loading