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

Add support for the expires option of ip route #1027

Closed
wants to merge 4 commits into from

Conversation

albertjin
Copy link

This is implemented through the attributes RTA_EXPIRES and RTA_CACHEINFO.

This is implemented through the attributes RTA_EXPIRES and RTA_CACHEINFO.
@@ -115,6 +128,9 @@ func (r Route) String() string {
elems = append(elems, fmt.Sprintf("Flags: %s", r.ListFlags()))
elems = append(elems, fmt.Sprintf("Table: %d", r.Table))
elems = append(elems, fmt.Sprintf("Realm: %d", r.Realm))
if r.Expires != 0 {
elems = append(elems, fmt.Sprintf("Expires: %dsec", r.Expires))
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we put a space b/w before "sec"?

Copy link
Author

Choose a reason for hiding this comment

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

This format is inherited from the ip route command. Note that the value can be negative because the kernel removes expired entries in a garbage collecting style.

Copy link
Collaborator

@aboch aboch left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution.

Please add a new or enhance an existing UT function to cover this functionality

Enhanced TestRoute6AddDel with expiry option. Route expiry is only supported for IPv6 with kernel 4.4+.
@aboch
Copy link
Collaborator

aboch commented Nov 6, 2024

Thanks @albertjin pls squash the two commits into one and push again.
This project follows a "1 commit per functionality/fix" approach.

jrife and others added 2 commits November 7, 2024 13:58
Link: https://lore.kernel.org/bpf/[email protected]/T/#u

Add support for the `expires` option of `ip route`

This is implemented through the attributes RTA_EXPIRES and RTA_CACHEINFO.

Add testing code for the route expiry option

Enhanced TestRoute6AddDel with expiry option. Route expiry is only supported for IPv6 with kernel 4.4+.
@albertjin albertjin closed this by deleting the head repository Nov 7, 2024
@albertjin
Copy link
Author

Thanks @albertjin pls squash the two commits into one and push again. This project follows a "1 commit per functionality/fix" approach.

I made a mistake in squashing and gave up. Simply recreated a pull request #1029

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