Ana Guerrero 2024-05-23 13:36:09 +00:00 committed by Git OBS Bridge
commit e3959ae6d1
3 changed files with 52 additions and 1 deletions

View File

@ -0,0 +1,43 @@
From 337125ce8d24ed66d7f4c7e6eef50458f3e7d154 Mon Sep 17 00:00:00 2001
From: Robert Karbowski <rkarbowski2@gmail.com>
Date: Sun, 19 May 2024 12:40:03 +0200
Subject: [PATCH] teamd: lw: arp_ping: bitmask VID in VLAN BPF filter
BPF filter arp_vlan_rpl_flt fails if in the ARP response the VLAN tag has,
in addition to VID, also PCP (priority code point).
This patch is masking the last 12 bits from SKF_AD_VLAN_TAG field
to extract VID only.
Signed-off-by: Robert Karbowski <robert_karbowski@hotmail.com>
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
---
teamd/teamd_lw_arp_ping.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/teamd/teamd_lw_arp_ping.c b/teamd/teamd_lw_arp_ping.c
index c3d4710..5b5c044 100644
--- a/teamd/teamd_lw_arp_ping.c
+++ b/teamd/teamd_lw_arp_ping.c
@@ -90,10 +90,11 @@ static const struct sock_fprog arp_novlan_rpl_fprog = {
static struct sock_filter arp_vlan_rpl_flt[] = {
BPF_STMT(BPF_LD + BPF_B + BPF_ABS, SKF_AD_OFF + SKF_AD_PROTOCOL),
- BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, ETH_P_ARP, 0, 8),
+ BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, ETH_P_ARP, 0, 9),
BPF_STMT(BPF_LD + BPF_B + BPF_ABS, SKF_AD_OFF + SKF_AD_VLAN_TAG_PRESENT),
- BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, 0, 6, 0),
+ BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, 0, 7, 0),
BPF_STMT(BPF_LD + BPF_B + BPF_ABS, SKF_AD_OFF + SKF_AD_VLAN_TAG),
+ BPF_STMT(BPF_ALU + BPF_AND + BPF_K, 0xfff),
BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, 0xffff, 0, 4), /* 0xffff will be replaced by vland id */
BPF_STMT(BPF_LD + BPF_H + BPF_ABS, OFFSET_ARP_OP_CODE),
BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, ARPOP_REPLY, 1, 0),
@@ -103,7 +104,7 @@ static struct sock_filter arp_vlan_rpl_flt[] = {
};
/* this hack replaces vlanid value in filter code */
-#define SET_FILTER_VLANID(fprog, vlanid) (fprog)->filter[5].k = vlanid
+#define SET_FILTER_VLANID(fprog, vlanid) (fprog)->filter[6].k = vlanid
static const struct sock_fprog arp_vlan_rpl_fprog = {
.len = ARRAY_SIZE(arp_vlan_rpl_flt),

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu May 23 11:22:27 UTC 2024 - Otto Hollmann <otto.hollmann@suse.com>
- teamd: lw: arp_ping: bitmask VID in VLAN BPF filter [bsc#1224798]
* Add 0001-teamd-lw-arp_ping-bitmask-VID-in-VLAN-BPF-filter.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Sep 26 14:47:59 UTC 2023 - Otto Hollmann <otto.hollmann@suse.com> Tue Sep 26 14:47:59 UTC 2023 - Otto Hollmann <otto.hollmann@suse.com>

View File

@ -1,7 +1,7 @@
# #
# spec file for package libteam # spec file for package libteam
# #
# Copyright (c) 2023 SUSE LLC # Copyright (c) 2024 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -35,6 +35,8 @@ Patch3: ignore_ebusy_for_team_hwaddr_set.patch
Patch4: 0001-allow-send_interface-dbus.patch Patch4: 0001-allow-send_interface-dbus.patch
Patch5: harden_teamd@.service.patch Patch5: harden_teamd@.service.patch
Patch6: better_handle_failures_to_chown.patch Patch6: better_handle_failures_to_chown.patch
# PATCH-FIX-UPSTREAM bsc#1224798 teamd: lw: arp_ping: bitmask VID in VLAN BPF filter
Patch7: 0001-teamd-lw-arp_ping-bitmask-VID-in-VLAN-BPF-filter.patch
BuildRequires: doxygen BuildRequires: doxygen
BuildRequires: libcap-devel BuildRequires: libcap-devel
BuildRequires: libtool BuildRequires: libtool