-
Notifications
You must be signed in to change notification settings - Fork 754
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
rule: Rule.Type to allow adding/listing unreachable (RTN_UNREACHABLE)… #1006
Conversation
This allows Tailscale to use this module while we wait for upstream PR to be merged. See vishvananda#1006 Updates vishvananda#710 Signed-off-by: Percy Wegmann <percy@tailscale.com>
This allows Tailscale to use this module while we wait for upstream PR to be merged. See vishvananda#1006 Updates tailscale/tailscale#12298 Signed-off-by: Percy Wegmann <percy@tailscale.com>
…equire vishvananda/netlink After the upstream PR is merged, we can point directly at github.com/vishvananda/netlink and retire github.com/tailscale/netlink. See vishvananda/netlink#1006 Updates #12298 Signed-off-by: Percy Wegmann <percy@tailscale.com>
6ccfaba
to
07d06f6
Compare
This allows Tailscale to use this module while we wait for upstream PR to be merged. See vishvananda#1006 Updates tailscale/tailscale#12298 Signed-off-by: Percy Wegmann <percy@tailscale.com>
…equire vishvananda/netlink After the upstream PR is merged, we can point directly at github.com/vishvananda/netlink and retire github.com/tailscale/netlink. See vishvananda/netlink#1006 Updates #12298 Signed-off-by: Percy Wegmann <percy@tailscale.com>
rule.go
Outdated
// Type is the unix.RTN_* rule type, such as RTN_UNICAST | ||
// or RTN_UNREACHABLE. | ||
// When adding a new rule, zero means automatic. | ||
// Only supported on Linux. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this element need all this explanation while all other ones don't?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to remove it if you prefer, it just seemed like useful documentation for any consumer of this new field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes let's remove it, unless it deviates from iproute2.
Assumption is who uses this library is familiar with iproute2 and can always look for reference uses there and check kernek code as well. Also you are adding UT which shows an example, which is great.
Thank you for your contribution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment removed.
07d06f6
to
e35bc30
Compare
rule_linux.go
Outdated
case unix.RTN_UNICAST: | ||
return "" | ||
case unix.RTN_LOCAL: | ||
return " local" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about having the leading space in the string. Let's have the print function add that. Not a big deal if we have a trailing space in the route entry when type == RTN_UNSPEC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Note that on Mac, we will always have a trailing space.
rule.go
Outdated
@@ -41,8 +42,8 @@ func (r Rule) String() string { | |||
to = r.Dst.String() | |||
} | |||
|
|||
return fmt.Sprintf("ip rule %d: from %s to %s table %d", | |||
r.Priority, from, to, r.Table) | |||
return fmt.Sprintf("ip rule %d: from %s to %s table %d%s", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am referring to this stringification of the IP Rule put a space here please
33bee70
to
5d7411d
Compare
…equire vishvananda/netlink After the upstream PR is merged, we can point directly at github.com/vishvananda/netlink and retire github.com/tailscale/netlink. See vishvananda/netlink#1006 Updates #12298 Signed-off-by: Percy Wegmann <percy@tailscale.com>
…BLE) rules Updates vishvananda#710 Co-authored-by: Brad Fitzpatrick <bradfitz@tailscale.com> Signed-off-by: Percy Wegmann <percy@tailscale.com>
5d7411d
to
db6fb0a
Compare
LGTM |
Thanks for the review @aboch ! |
…equire vishvananda/netlink After the upstream PR is merged, we can point directly at github.com/vishvananda/netlink and retire github.com/tailscale/netlink. See vishvananda/netlink#1006 Updates tailscale#12298 Signed-off-by: Percy Wegmann <percy@tailscale.com>
… rules
Updates #710