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

Optimize specifing port range with binary mask #153

Merged
merged 27 commits into from
Jul 15, 2023

Conversation

hengyoush
Copy link
Contributor

@hengyoush hengyoush commented May 7, 2023

for issue chaosblade-io/chaosblade#885
主要改动如下:

  1. 增加buildMaskForRange函数, 计算表达给定整数区间的掩码.
  2. 端口等参数采用区间列表的形式, 方便计算掩码
  3. 增加TestBuildMaskForRange测试, 用于验证buildMaskForRange函数的正确性

@hengyoush hengyoush force-pushed the feature-tc-mask branch 2 times, most recently from 3781ff3 to ca6277c Compare May 10, 2023 15:28
@tiny-x tiny-x added this to the v1.7.2 milestone May 11, 2023
@tiny-x tiny-x added the type/enhancement New feature or request label May 11, 2023
@tiny-x tiny-x requested a review from MandssS May 11, 2023 06:28
`%s && \
tc filter add dev %s parent 1: prio 4 protocol ip u32 match ip dport %s 0xffff flowid 1:4 && \
tc filter add dev %s parent 1: prio 4 protocol ip u32 match ip sport %s 0xffff flowid 1:4`,
args, netInterface, port, netInterface, port)
Copy link
Contributor

Choose a reason for hiding this comment

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

这里port从哪来的?

Copy link
Contributor Author

@hengyoush hengyoush May 15, 2023

Choose a reason for hiding this comment

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

done
和其他提交的代码冲突了(#149)

`%s && \
tc filter add dev %s parent 1: prio 4 protocol ip u32 match ip dport %s 0xffff flowid 1:4 && \
tc filter add dev %s parent 1: prio 4 protocol ip u32 match ip sport %s 0xffff flowid 1:4`,
args, netInterface, port, netInterface, port)
}
return args
}
Copy link
Contributor

Choose a reason for hiding this comment

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

少了一个 }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

MandssS and others added 23 commits May 15, 2023 22:52
Signed-off-by: caimingxia <mingshao.cmx@alibaba-inc.com>
Signed-off-by: hengyoush <hengyoush1@163.com>
Signed-off-by: tiny-x <xf.yefei@gmail.com>
Signed-off-by: hengyoush <hengyoush1@163.com>
Signed-off-by: Icesource <gonghuajian.ghj@alibaba-inc.com>
Signed-off-by: hengyoush <hengyoush1@163.com>
in some occasion, we still need to kill or stop process by declaring a specified pid explicitly

Signed-off-by: xushunke <387617982@qq.com>
Signed-off-by: hengyoush <hengyoush1@163.com>
Signed-off-by: caimingxia <mingshao.cmx@alibaba-inc.com>
Signed-off-by: hengyoush <hengyoush1@163.com>
Signed-off-by: caimingxia <mingshao.cmx@alibaba-inc.com>
Signed-off-by: hengyoush <hengyoush1@163.com>
Signed-off-by: binbin0325 <binbin0325@apache.org>
Signed-off-by: hengyoush <hengyoush1@163.com>
Signed-off-by: chengaolin123 <chengaolin@njzfit.cn>
Signed-off-by: hengyoush <hengyoush1@163.com>
Signed-off-by: chengaolin123 <chengaolin@njzfit.cn>
Signed-off-by: hengyoush <hengyoush1@163.com>
Signed-off-by: Forestls430 <linsen@njzfit.cn>
Signed-off-by: hengyoush <hengyoush1@163.com>
Signed-off-by: linsen <linsen430@163.com>
Signed-off-by: hengyoush <hengyoush1@163.com>
…io#116)

Signed-off-by: Super-long <0x4f4f4f4f@gmail.com>
Co-authored-by: tiny-x <xf.yefei@gmail.com>
Signed-off-by: hengyoush <hengyoush1@163.com>
Signed-off-by: xinmian <xinmian404@163.com>
Signed-off-by: hengyoush <hengyoush1@163.com>
Signed-off-by: caimingxia <mingshao.cmx@alibaba-inc.com>
Signed-off-by: hengyoush <hengyoush1@163.com>
Signed-off-by: caimingxia <mingshao.cmx@alibaba-inc.com>
Signed-off-by: hengyoush <hengyoush1@163.com>
Signed-off-by: hengyoush <hengyoush1@163.com>
Signed-off-by: hengyoush <hengyoush1@163.com>
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.0.0-20210711020723-a769d52b0f97 to 0.1.0.
- [Release notes](https://github.com/golang/crypto/releases)
- [Commits](https://github.com/golang/crypto/commits/v0.1.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: hengyoush <hengyoush1@163.com>
Signed-off-by: Yuaninga <1846225041@qq.com>
Signed-off-by: hengyoush <hengyoush1@163.com>
Signed-off-by: lengdanran <lengdanran@126.com>
Signed-off-by: hengyoush <hengyoush1@163.com>
Signed-off-by: hengyoush <hengyoush1@163.com>
Signed-off-by: lengdanran <lengdanran@126.com>
Signed-off-by: hengyoush <hengyoush1@163.com>
MandssS and others added 3 commits May 15, 2023 22:55
Signed-off-by: caimingxia <mingshao.cmx@alibaba-inc.com>
Signed-off-by: hengyoush <hengyoush1@163.com>
Signed-off-by: caimingxia <mingshao.cmx@alibaba-inc.com>
Signed-off-by: hengyoush <hengyoush1@163.com>
resolve conflict

Signed-off-by: hengyoush <hengyoush1@163.com>
@hengyoush hengyoush requested a review from MandssS May 16, 2023 03:36
@MandssS MandssS modified the milestones: v1.7.2, v1.7.3 Jun 15, 2023
Copy link
Member

@binbin0325 binbin0325 left a comment

Choose a reason for hiding this comment

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

ip has the same problem (too long parameters), is there a solution similar to port?

@hengyoush
Copy link
Contributor Author

hengyoush commented Jul 4, 2023

ip has the same problem (too long parameters), is there a solution similar to port?

For ip we can use subnet mask?

@MandssS MandssS merged commit 041a22c into chaosblade-io:master Jul 15, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement New feature or request
Projects
None yet