Skip to content

rule: add support for dport/sport#511

Merged
aboch merged 1 commit intovishvananda:masterfrom
chendotjs:rule-support-port
Feb 10, 2020
Merged

rule: add support for dport/sport#511
aboch merged 1 commit intovishvananda:masterfrom
chendotjs:rule-support-port

Conversation

@chendotjs
Copy link
Copy Markdown
Contributor

This PR adds ability equivalent to ip rule add dport xxx-xxx sport xxx table main

@chendotjs chendotjs requested a review from aboch January 17, 2020 15:30
}

// RulePortRange creates rule sport/dport range.
func NewRulePortRange(start, end uint16) *RulePortRange {
Copy link
Copy Markdown
Collaborator

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)

Copy link
Copy Markdown
Contributor Author

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.

@aboch
Copy link
Copy Markdown
Collaborator

aboch commented Feb 9, 2020

@chendotjs pls rebase

@chendotjs
Copy link
Copy Markdown
Contributor Author

@aboch done

@aboch
Copy link
Copy Markdown
Collaborator

aboch commented Feb 10, 2020

LGTM

@aboch aboch merged commit a2e8781 into vishvananda:master Feb 10, 2020
MrHohn added a commit to MrHohn/netlink that referenced this pull request Aug 26, 2021
This is similar to vishvananda#511,
but this time for the ipproto option:
```
ip rule add ipproto xxx table main
```
MrHohn added a commit to MrHohn/netlink that referenced this pull request Aug 26, 2021
This is similar to vishvananda#511,
but this time for the ipproto option:
```
ip rule add ipproto xxx table main
```
MrHohn added a commit to MrHohn/netlink that referenced this pull request Sep 30, 2021
This is similar to vishvananda#511,
but this time for the ipproto option:
```
ip rule add ipproto xxx table main
```
MrHohn added a commit to MrHohn/netlink that referenced this pull request Jan 12, 2022
This is similar to vishvananda#511,
but this time for the ipproto option:
```
ip rule add ipproto xxx table main
```
glazychev-art pushed a commit to glazychev-art/netlink that referenced this pull request Jan 18, 2022
This is similar to vishvananda#511,
but this time for the ipproto option:
```
ip rule add ipproto xxx table main
```
vishvananda pushed a commit that referenced this pull request Jan 18, 2022
This is similar to #511,
but this time for the ipproto option:
```
ip rule add ipproto xxx table main
```
cyberys pushed a commit to cyberys/netlink that referenced this pull request Apr 5, 2022
This is similar to vishvananda#511,
but this time for the ipproto option:
```
ip rule add ipproto xxx table main
```
cjmakes pushed a commit to cjmakes/netlink that referenced this pull request Jun 29, 2022
This is similar to vishvananda#511,
but this time for the ipproto option:
```
ip rule add ipproto xxx table main
```
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.

2 participants