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

Conversation

AndryNick98
Copy link
Collaborator

Description

With eos devices, when we have an entry with protocol = connected we put 0.0.0.0 as nexthopIps while we should leave it empty.
The PR fix it

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Double Check

  • I have read the comments and followed the CONTRIBUTING.md.
  • I have explained my PR according to the information in the comments or in a linked issue.
  • My PR source branch is created from the develop branch.
  • My PR targets the develop branch.
  • All my commits have --signoff applied

In some cases we receive 0.0.0.0 as nexthopIps for an entry where
the protocol is connected. In those cases the nexthopIps list must
be empty

Signed-off-by: AndryNick98 <[email protected]>
@@ -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.

@ddutt ddutt merged commit 7499645 into develop May 23, 2024
13 checks passed
@ddutt ddutt deleted the fix-routes-eos-connected branch May 23, 2024 21:43
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.

3 participants