-
Notifications
You must be signed in to change notification settings - Fork 745
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: add support for dport/sport #511
Conversation
d284d7a
to
2ebb088
Compare
@@ -40,3 +42,14 @@ func NewRule() *Rule { | |||
Flow: -1, | |||
} | |||
} | |||
|
|||
// RulePortRange creates rule sport/dport range. | |||
func NewRulePortRange(start, end uint16) *RulePortRange { |
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 not making this a method of Rule
structure ?
(r *Rule) AddPortRange(start, end uint16)
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.
Thanks for review @aboch
(r *Rule) AddPortRange(start, end uint16)
may need another parameter to specify it's a Src or a Dst port range, which might add more complexity.
IMO, current fields of Rule
structure is assigned by users manually, so NewRulePortRange
is enough.
2ebb088
to
f83ba96
Compare
@chendotjs pls rebase |
f83ba96
to
0be5b22
Compare
@aboch done |
LGTM |
This is similar to vishvananda#511, but this time for the ipproto option: ``` ip rule add ipproto xxx table main ```
This is similar to vishvananda#511, but this time for the ipproto option: ``` ip rule add ipproto xxx table main ```
This is similar to vishvananda#511, but this time for the ipproto option: ``` ip rule add ipproto xxx table main ```
This is similar to vishvananda#511, but this time for the ipproto option: ``` ip rule add ipproto xxx table main ```
This is similar to vishvananda#511, but this time for the ipproto option: ``` ip rule add ipproto xxx table main ```
This is similar to #511, but this time for the ipproto option: ``` ip rule add ipproto xxx table main ```
This is similar to vishvananda#511, but this time for the ipproto option: ``` ip rule add ipproto xxx table main ```
This is similar to vishvananda#511, but this time for the ipproto option: ``` ip rule add ipproto xxx table main ```
This PR adds ability equivalent to
ip rule add dport xxx-xxx sport xxx table main