packages/net/openvswitch/patches/0101-netdev-linux-Let-interface-flag-survive-internal-por.patch
Yousong Zhou 1b485efbcb openvswitch: bump to version 2.10.0
- Rebased the python target/host separation patch
 - Dropped the now-in-upstream openssl-1.1 compat patch
 - Added a patch to disable tests/

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2018-08-21 13:51:37 +00:00

38 lines
1.5 KiB
Diff

From a3eabe1e639c98ce8537df4ac4187a8c047dac59 Mon Sep 17 00:00:00 2001
From: Helmut Schaa <helmut.schaa@googlemail.com>
Date: Wed, 8 Jan 2014 13:48:49 +0100
Subject: [PATCH 101/105] netdev-linux: Let interface flag survive internal
port setup
Due to a race condition when bringing up an internal port on Linux
some interface flags (e.g. IFF_MULTICAST) are falsely reset. This
happens because netlink events may be processed after the according
netdev has been brought up (which sets interface flags).
Fix this by reading the interface flags just before updating them
if they have not been updated by from the kernel yet.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
---
lib/netdev-linux.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index 5ada9a21f..bb8275cfa 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -3118,7 +3118,13 @@ update_flags(struct netdev_linux *netdev, enum netdev_flags off,
unsigned int old_flags, new_flags;
int error = 0;
- old_flags = netdev->ifi_flags;
+ if (!(netdev->cache_valid & VALID_DRVINFO)) {
+ /* Most likely the debvice flags are not in sync yet, fetch them now */
+ get_flags(&netdev->up, &old_flags);
+ } else {
+ old_flags = netdev->ifi_flags;
+ }
+
*old_flagsp = iff_to_nd_flags(old_flags);
new_flags = (old_flags & ~nd_to_iff_flags(off)) | nd_to_iff_flags(on);
if (new_flags != old_flags) {