gvisor icon indicating copy to clipboard operation
gvisor copied to clipboard

Longest prefix match

Open mikma opened this issue 4 years ago • 4 comments

Sort the route table in descending sort order based on the prefix length. This way finding the route in the route table will result in longest prefix match, as is expected.

Fixes #1769

mikma avatar Feb 05 '21 23:02 mikma

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

google-cla[bot] avatar Feb 05 '21 23:02 google-cla[bot]

@googlebot I fixed it.

mikma avatar Feb 05 '21 23:02 mikma

I'm having problem understanding why subnet masks which aren't in the canonical form (i.e they don't represent a CIDR prefix) are allowed in the tcpip package. I don't think it makes sense to add routes to such subnets/prefixes to the route table.

My proposition is to require that subnet masks must be in canonical form, and I have added a verification to tcpip.NewSubnet in a separate commit together with updated test cases.

mikma avatar Feb 13 '21 22:02 mikma

I updated the branch with a new version which doesn't change NewSubnet, but instead validates the routes in SetRouteTable, and AddRoute.

mikma avatar Feb 15 '21 22:02 mikma

A friendly reminder that this PR had no activity for 120 days.

github-actions[bot] avatar Sep 14 '23 00:09 github-actions[bot]

This PR has been closed due to lack of activity.

github-actions[bot] avatar Dec 14 '23 00:12 github-actions[bot]