You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "bhouse-nexthop (via GitHub)" <gi...@apache.org> on 2026/10/08 00:49:11 UTC
[PR] Routed network ACL: match protocol-number rules with ip protocol, not ip nexthdr [cloudstack]
bhouse-nexthop opened a new pull request, #14352:
URL: https://github.com/apache/cloudstack/pull/14352
### Description
On a network in routed mode, a network ACL rule that uses a protocol number (e.g. `47` for GRE) is never applied on the VR.
Fixes #14351
#### Why it breaks
In routed mode the VR renders IPv4 ACL rules as nftables, in `CsAcl.AclDevice.__process_routing_ip4()`. A protocol-number rule was rendered as `ip nexthdr 47`. `nexthdr` is an IPv6 header field, so nft rejects it in an `ip` rule:
```
Error: syntax error, unexpected string
add rule ip ip4_acl eth3_ingress_policy ip saddr 1.2.3.4/32 ip nexthdr 47 accept
^^^^^^^
```
The rules are added one `nft add rule` at a time and the failure is only logged in `/var/log/cloud.log`. So the rule is silently missing from `ip4_acl` while the rest of the list loads:
- an allow rule for that protocol never matches;
- a deny rule for it is lost, and the traffic falls through to whatever later rule matches it.
This was introduced with routed mode in #9470 (4.20).
#### How it is fixed
The IPv4 match now uses the IPv4 field, `ip protocol <n>`. The IPv6 path in `__process_ip6()` already uses `ip6 nexthdr <n>`, which is correct, and is unchanged.
#### How to reproduce the old behaviour
1. Create a VPC or network in routed mode with an IPv4 tier.
2. Add an ACL rule to the tier's ACL list: protocol number `47`, CIDR `1.2.3.4/32`, action Allow. Add a TCP 22 rule from the same CIDR for contrast.
3. On the VR, run `nft list chain ip ip4_acl ethX_ingress_policy`.
Before (the GRE rule is missing and `cloud.log` holds the syntax error above):
```
ip saddr 1.2.3.4 tcp dport 22 accept
counter packets 0 bytes 0 drop
```
After:
```
ip saddr 1.2.3.4 ip protocol gre accept
ip saddr 1.2.3.4 tcp dport 22 accept
counter packets 0 bytes 0 drop
```
### Types of changes
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] Enhancement (improves an existing feature and functionality)
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
- [ ] Build/CI
- [x] Test (unit or integration test code)
### Feature/Enhancement Scale or Bug Severity
#### Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [ ] Major
- [x] Minor
- [ ] Trivial
### How Has This Been Tested?
- New `systemvm/test/TestCsAclRouting.py` checks the rendered IPv4 rule, and that the IPv6 rule keeps `ip6 nexthdr`. It fails on the current `4.22` code and passes with this change. (Nothing in `.github/workflows` runs `systemvm/test`, so it runs via `systemvm/test/runtests.sh`.)
- The before/after chains above are real output. They come from feeding the rules `AclDevice` generates through the unmodified `CsNetfilters.apply_nft_ipv4_rules()` into real nft (1.0.9) in a network namespace. `ip protocol 47` was also checked on nft 1.0.6, the version in the Debian 12 systemvm template.
- `pycodestyle` and `pylint` (as in `runtests.sh`) report nothing new.
#### How did you try to break this feature and the system with this change?
- Only `type == "protocol"` rules go through this line. tcp, udp, icmp and all rules render exactly as before.
- This is independent of #14350, which touches the CIDR handling a few lines below. The two apply cleanly in either order.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Routed network ACL: match protocol-number rules with ip protocol, not ip nexthdr [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland merged PR #14352:
URL: https://github.com/apache/cloudstack/pull/14352
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Routed network ACL: match protocol-number rules with ip protocol, not ip nexthdr [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #14352:
URL: https://github.com/apache/cloudstack/pull/14352#issuecomment-6267168275
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Routed network ACL: match protocol-number rules with ip protocol, not ip nexthdr [cloudstack]
Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #14352:
URL: https://github.com/apache/cloudstack/pull/14352#issuecomment-6343504793
> @bhouse-nexthop what about ipv6 rule ?
>
> ```
> # git grep nexthdr
> systemvm/debian/opt/cloud/bin/configure.py: protocol = "ip nexthdr %d" % rule['protocol']
> systemvm/debian/opt/cloud/bin/configure.py: protocol = "ip6 nexthdr %d" % rule['protocol']
> ```
#14360
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Routed network ACL: match protocol-number rules with ip protocol, not ip nexthdr [cloudstack]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #14352:
URL: https://github.com/apache/cloudstack/pull/14352#issuecomment-6049962433
## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/14352?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 4.04%. Comparing base ([`2974af8`](https://app.codecov.io/gh/apache/cloudstack/commit/2974af84f22a8def8339380628d8653a4f016d3f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`2255622`](https://app.codecov.io/gh/apache/cloudstack/commit/22556225ffc4bf423f4b5e9a14c2d0e1635a97ee?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
> :exclamation: There is a different number of reports uploaded between BASE (2974af8) and HEAD (2255622). Click for more details.
>
> <details><summary>HEAD has 1 upload less than BASE</summary>
>
>| Flag | BASE (2974af8) | HEAD (2255622) |
>|------|------|------|
>|unittests|1|0|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## 4.22 #14352 +/- ##
=============================================
- Coverage 18.02% 4.04% -13.99%
=============================================
Files 5936 449 -5487
Lines 535823 38240 -497583
Branches 65612 7082 -58530
=============================================
- Hits 96582 1546 -95036
+ Misses 428242 36482 -391760
+ Partials 10999 212 -10787
```
| [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/14352/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/14352/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `4.04% <ø> (ø)` | |
| [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/14352/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/cloudstack/pull/14352?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Routed network ACL: match protocol-number rules with ip protocol, not ip nexthdr [cloudstack]
Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #14352:
URL: https://github.com/apache/cloudstack/pull/14352#issuecomment-6267209514
> clgtm, not sure if smoke test run would be enough for proving this.
smoke test does not cover it I think.
but @bhouse-nexthop could add the validation in smoke test
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Routed network ACL: match protocol-number rules with ip protocol, not ip nexthdr [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #14352:
URL: https://github.com/apache/cloudstack/pull/14352#issuecomment-6267137552
@blueorangutan package
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Routed network ACL: match protocol-number rules with ip protocol, not ip nexthdr [cloudstack]
Posted by "bhouse-nexthop (via GitHub)" <gi...@apache.org>.
bhouse-nexthop commented on PR #14352:
URL: https://github.com/apache/cloudstack/pull/14352#issuecomment-6049855426
@vladimirpetrov @sureshanaparti could you take a look at this one? We'd like this fix to make it into the upcoming 4.22.2 release.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Routed network ACL: match protocol-number rules with ip protocol, not ip nexthdr [cloudstack]
Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #14352:
URL: https://github.com/apache/cloudstack/pull/14352#issuecomment-6337684403
@bhouse-nexthop
can you also add some rules in test/integration/smoke/test_ipv4_routing.py to verify the case ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Routed network ACL: match protocol-number rules with ip protocol, not ip nexthdr [cloudstack]
Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #14352:
URL: https://github.com/apache/cloudstack/pull/14352#issuecomment-6267228294
what about ipv6 rule ?
```
# git grep nexthdr
systemvm/debian/opt/cloud/bin/configure.py: protocol = "ip nexthdr %d" % rule['protocol']
systemvm/debian/opt/cloud/bin/configure.py: protocol = "ip6 nexthdr %d" % rule['protocol']
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Routed network ACL: match protocol-number rules with ip protocol, not ip nexthdr [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #14352:
URL: https://github.com/apache/cloudstack/pull/14352#issuecomment-6268823749
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✖️ suse15. SL-JID 19604
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Routed network ACL: match protocol-number rules with ip protocol, not ip nexthdr [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #14352:
URL: https://github.com/apache/cloudstack/pull/14352#issuecomment-6267163101
as a side note, @bhouse-nexthop , you mentioned this is an issue on 4.20.x as well but based it on 4.22. care to rebase?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org