From: Stefan Hanreich <s.hanreich@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH proxmox-firewall 3/3] guest: match arp packets via meta
Date: Wed, 3 Jul 2024 11:17:12 +0200 [thread overview]
Message-ID: <20240703091712.99197-3-s.hanreich@proxmox.com> (raw)
In-Reply-To: <20240703091712.99197-1-s.hanreich@proxmox.com>
When matching via ether type, VLAN packets are not matched. This can
cause ARP packets encapsulated in VLAN frames to be dropped.
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---
proxmox-firewall/src/firewall.rs | 2 +-
.../tests/snapshots/integration_tests__firewall.snap | 10 ++++------
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/proxmox-firewall/src/firewall.rs b/proxmox-firewall/src/firewall.rs
index 4ea81df..941aa20 100644
--- a/proxmox-firewall/src/firewall.rs
+++ b/proxmox-firewall/src/firewall.rs
@@ -538,7 +538,7 @@ impl Firewall {
// we allow outgoing ARP, except if blocked by the MAC filter above
let arp_rule = vec![
- Match::new_eq(Payload::field("ether", "type"), Expression::from("arp")).into(),
+ Match::new_eq(Meta::new("protocol"), Expression::from("arp")).into(),
Statement::make_accept(),
];
diff --git a/proxmox-firewall/tests/snapshots/integration_tests__firewall.snap b/proxmox-firewall/tests/snapshots/integration_tests__firewall.snap
index e1953e0..40d4405 100644
--- a/proxmox-firewall/tests/snapshots/integration_tests__firewall.snap
+++ b/proxmox-firewall/tests/snapshots/integration_tests__firewall.snap
@@ -2961,9 +2961,8 @@ expression: "firewall.full_host_fw().expect(\"firewall can be generated\")"
"match": {
"op": "==",
"left": {
- "payload": {
- "protocol": "ether",
- "field": "type"
+ "meta": {
+ "key": "protocol"
}
},
"right": "arp"
@@ -3623,9 +3622,8 @@ expression: "firewall.full_host_fw().expect(\"firewall can be generated\")"
"match": {
"op": "==",
"left": {
- "payload": {
- "protocol": "ether",
- "field": "type"
+ "meta": {
+ "key": "protocol"
}
},
"right": "arp"
--
2.39.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2024-07-03 9:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-03 9:17 [pve-devel] [PATCH proxmox-firewall 1/3] cargo: bump dependencies of proxmox-ve-config Stefan Hanreich
2024-07-03 9:17 ` [pve-devel] [PATCH proxmox-firewall 2/3] conntrack: arp: move handling to guest chains Stefan Hanreich
2024-07-03 9:17 ` Stefan Hanreich [this message]
2024-07-22 16:23 ` [pve-devel] applied: [PATCH proxmox-firewall 1/3] cargo: bump dependencies of proxmox-ve-config Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240703091712.99197-3-s.hanreich@proxmox.com \
--to=s.hanreich@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox