forked from nmstate/nmstate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
route: correctly compare the route's next-hop
In nmstate routes without next-hop are represented with "0.0.0.0" or "::". This is because we need to differentiate the case "I don't care about the next-hop for routes matching" (next-hop=None) and "This route doesn't have next-hop" (next-hop=0.0.0.0). However, NM doesn't do the same because it doesn't need that differentiation. If a NM profile contains a direct route, without next-hop, it will just leave it empty, thus we get next-hop=None. This causes that comparing an NmIpRoute created from a nmstate route with an NmIpRoute created from an existing NM profile will fail because of this difference. Fix it by converting "0.0.0.0" / "::" to None when creating a NmIpRoute from an nmstate route. This is the right representation for it at `nm` layer, anyway. Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
- Loading branch information
Showing
3 changed files
with
88 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters