Skip to content

Add "default" dst while no DST attr responsed from nl#852

Merged
aboch merged 1 commit intovishvananda:mainfrom
PlatformLC:default_route
Jun 4, 2023
Merged

Add "default" dst while no DST attr responsed from nl#852
aboch merged 1 commit intovishvananda:mainfrom
PlatformLC:default_route

Conversation

@PlatformLC
Copy link
Contributor

For #670 && #611 are both introduced by "default" route.

There is indeed no attribute tlv encoded for RTA_DST while doing RTM_GETROUTE requests, but while we doing ADD/DELETE opearation, we do need encode such "default" dst (i.e., 0.0.0.0/0 or ::/0).
This introduced the inconsistence between "read" and "write" and lead failure for flushing the route table(deleting all routes from what listed)

Refer to iproute2 implementation, add the same logic for deserializeRoute

@PlatformLC
Copy link
Contributor Author

@vishvananda Would you have a look at this?

Copy link

@martinkennelly martinkennelly left a comment

Choose a reason for hiding this comment

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

I need this too :)

@aboch
Copy link
Collaborator

aboch commented Jun 2, 2023

@PlatformLC Please squash your two commits into one.
This project follows a one-commit-per-PR scheme

@vishvananda
Copy link
Owner

this looks good, if you squash as @aboch requested we can merge it.

@PlatformLC
Copy link
Contributor Author

@PlatformLC Please squash your two commits into one. This project follows a one-commit-per-PR scheme

Updated. PTAL

@aboch aboch merged commit acdc658 into vishvananda:main Jun 4, 2023
@PlatformLC PlatformLC deleted the default_route branch June 5, 2023 02:55
martinkennelly added a commit to martinkennelly/ovn-kubernetes-1 that referenced this pull request Aug 4, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes-1 that referenced this pull request Aug 4, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes that referenced this pull request Aug 5, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes that referenced this pull request Aug 5, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes that referenced this pull request Aug 7, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes-1 that referenced this pull request Aug 7, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes-1 that referenced this pull request Aug 7, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes-1 that referenced this pull request Aug 7, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes that referenced this pull request Aug 7, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes-1 that referenced this pull request Aug 8, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes-1 that referenced this pull request Aug 8, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes-1 that referenced this pull request Aug 8, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes that referenced this pull request Aug 9, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes-1 that referenced this pull request Aug 10, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes that referenced this pull request Aug 10, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes-1 that referenced this pull request Aug 10, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes-1 that referenced this pull request Aug 10, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes that referenced this pull request Aug 11, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes-1 that referenced this pull request Aug 13, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes that referenced this pull request Aug 13, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes-1 that referenced this pull request Aug 16, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes that referenced this pull request Aug 16, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes that referenced this pull request Aug 16, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes that referenced this pull request Aug 16, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes that referenced this pull request Aug 16, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
(cherry picked from commit 4400ad54d0bc4e95f0e5e2a09d91795510e1c3f2)
martinkennelly added a commit to martinkennelly/ovn-kubernetes-1 that referenced this pull request Aug 16, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes that referenced this pull request Aug 16, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
(cherry picked from commit cc0de3c)
martinkennelly added a commit to martinkennelly/ovn-kubernetes that referenced this pull request Aug 17, 2023
Refactor route manager to reflect it is now its own pkg
and should be renamed.

Netlink library represents a dst with CIDR '0.0.0.0/0',
aka 'blackhole' route as dst = nil, therefore we must
work around this.

This should be fixed with PR:
vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
(cherry picked from commit cc0de3c)
martinkennelly added a commit to martinkennelly/ovn-kubernetes-1 that referenced this pull request Nov 13, 2023
Netlink lib merged their default route fix [1].
The issue was the lib represented an 'any' route
(aka 0.0.0.0/0 for v4) as dst = nil. If a user
wanted to set an any route, they must explicitly set
dst not nil. Therefore looking at a system and looking
at what the user wanted for any routes added extra
complexity. Upgrade the pkg to remove that complexity.

[1] vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes-1 that referenced this pull request Nov 18, 2023
Netlink lib merged their default route fix [1].
The issue was the lib represented an 'any' route
(aka 0.0.0.0/0 for v4) as dst = nil. If a user
wanted to set an any route, they must explicitly set
dst not nil. Therefore looking at a system and looking
at what the user wanted for any routes added extra
complexity. Upgrade the pkg to remove that complexity.

[1] vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes-1 that referenced this pull request Nov 26, 2023
Netlink lib merged their default route fix [1].
The issue was the lib represented an 'any' route
(aka 0.0.0.0/0 for v4) as dst = nil. If a user
wanted to set an any route, they must explicitly set
dst not nil. Therefore looking at a system and looking
at what the user wanted for any routes added extra
complexity. Upgrade the pkg to remove that complexity.

[1] vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes-1 that referenced this pull request Dec 3, 2023
Netlink lib merged their default route fix [1].
The issue was the lib represented an 'any' route
(aka 0.0.0.0/0 for v4) as dst = nil. If a user
wanted to set an any route, they must explicitly set
dst not nil. Therefore looking at a system and looking
at what the user wanted for any routes added extra
complexity. Upgrade the pkg to remove that complexity.

[1] vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes-1 that referenced this pull request Dec 6, 2023
Netlink lib merged their default route fix [1].
The issue was the lib represented an 'any' route
(aka 0.0.0.0/0 for v4) as dst = nil. If a user
wanted to set an any route, they must explicitly set
dst not nil. Therefore looking at a system and looking
at what the user wanted for any routes added extra
complexity. Upgrade the pkg to remove that complexity.

[1] vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes-1 that referenced this pull request Dec 6, 2023
Netlink lib merged their default route fix [1].
The issue was the lib represented an 'any' route
(aka 0.0.0.0/0 for v4) as dst = nil. If a user
wanted to set an any route, they must explicitly set
dst not nil. Therefore looking at a system and looking
at what the user wanted for any routes added extra
complexity. Upgrade the pkg to remove that complexity.

[1] vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes that referenced this pull request Dec 6, 2023
Netlink lib merged their default route fix [1].
The issue was the lib represented an 'any' route
(aka 0.0.0.0/0 for v4) as dst = nil. If a user
wanted to set an any route, they must explicitly set
dst not nil. Therefore looking at a system and looking
at what the user wanted for any routes added extra
complexity. Upgrade the pkg to remove that complexity.

[1] vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes that referenced this pull request Dec 8, 2023
Netlink lib merged their default route fix [1].
The issue was the lib represented an 'any' route
(aka 0.0.0.0/0 for v4) as dst = nil. If a user
wanted to set an any route, they must explicitly set
dst not nil. Therefore looking at a system and looking
at what the user wanted for any routes added extra
complexity. Upgrade the pkg to remove that complexity.

[1] vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes-1 that referenced this pull request Dec 18, 2023
Netlink lib merged their default route fix [1].
The issue was the lib represented an 'any' route
(aka 0.0.0.0/0 for v4) as dst = nil. If a user
wanted to set an any route, they must explicitly set
dst not nil. Therefore looking at a system and looking
at what the user wanted for any routes added extra
complexity. Upgrade the pkg to remove that complexity.

[1] vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes-1 that referenced this pull request Jan 2, 2024
Netlink lib merged their default route fix [1].
The issue was the lib represented an 'any' route
(aka 0.0.0.0/0 for v4) as dst = nil. If a user
wanted to set an any route, they must explicitly set
dst not nil. Therefore looking at a system and looking
at what the user wanted for any routes added extra
complexity. Upgrade the pkg to remove that complexity.

[1] vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes-1 that referenced this pull request Jan 9, 2024
Netlink lib merged their default route fix [1].
The issue was the lib represented an 'any' route
(aka 0.0.0.0/0 for v4) as dst = nil. If a user
wanted to set an any route, they must explicitly set
dst not nil. Therefore looking at a system and looking
at what the user wanted for any routes added extra
complexity. Upgrade the pkg to remove that complexity.

[1] vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes-1 that referenced this pull request Jan 14, 2024
Netlink lib merged their default route fix [1].
The issue was the lib represented an 'any' route
(aka 0.0.0.0/0 for v4) as dst = nil. If a user
wanted to set an any route, they must explicitly set
dst not nil. Therefore looking at a system and looking
at what the user wanted for any routes added extra
complexity. Upgrade the pkg to remove that complexity.

[1] vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes-1 that referenced this pull request Jan 29, 2024
Netlink lib merged their default route fix [1].
The issue was the lib represented an 'any' route
(aka 0.0.0.0/0 for v4) as dst = nil. If a user
wanted to set an any route, they must explicitly set
dst not nil. Therefore looking at a system and looking
at what the user wanted for any routes added extra
complexity. Upgrade the pkg to remove that complexity.

[1] vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes-1 that referenced this pull request Jan 29, 2024
Netlink lib merged their default route fix [1].
The issue was the lib represented an 'any' route
(aka 0.0.0.0/0 for v4) as dst = nil. If a user
wanted to set an any route, they must explicitly set
dst not nil. Therefore looking at a system and looking
at what the user wanted for any routes added extra
complexity. Upgrade the pkg to remove that complexity.

[1] vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
martinkennelly added a commit to martinkennelly/ovn-kubernetes that referenced this pull request Mar 28, 2024
Netlink lib merged their default route fix [1].
The issue was the lib represented an 'any' route
(aka 0.0.0.0/0 for v4) as dst = nil. If a user
wanted to set an any route, they must explicitly set
dst not nil. Therefore looking at a system and looking
at what the user wanted for any routes added extra
complexity. Upgrade the pkg to remove that complexity.

[1] vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
(cherry picked from commit 2b97bea)
martinkennelly added a commit to martinkennelly/ovn-kubernetes that referenced this pull request Mar 28, 2024
Netlink lib merged their default route fix [1].
The issue was the lib represented an 'any' route
(aka 0.0.0.0/0 for v4) as dst = nil. If a user
wanted to set an any route, they must explicitly set
dst not nil. Therefore looking at a system and looking
at what the user wanted for any routes added extra
complexity. Upgrade the pkg to remove that complexity.

[1] vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
(cherry picked from commit 2b97bea)
martinkennelly added a commit to martinkennelly/ovn-kubernetes that referenced this pull request Apr 8, 2024
Netlink lib merged their default route fix [1].
The issue was the lib represented an 'any' route
(aka 0.0.0.0/0 for v4) as dst = nil. If a user
wanted to set an any route, they must explicitly set
dst not nil. Therefore looking at a system and looking
at what the user wanted for any routes added extra
complexity. Upgrade the pkg to remove that complexity.

[1] vishvananda/netlink#852

Signed-off-by: Martin Kennelly <[email protected]>
(cherry picked from commit 2b97bea)
Luap99 added a commit to Luap99/libpod that referenced this pull request Aug 26, 2024
There seems to be one change[1] which breaks our tests, the route Dst field
is no longer nil for a default route but rather the empty ipnet, i.e.
0.0.0.0/0 and ::/0 so fix that up in our code.

[1] vishvananda/netlink#852

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

4 participants