netifd: update and revert problematic patch

Fixes VLANs with shell protos on top of WLAN devices.

Fixes #754
This commit is contained in:
Matthias Schiffer 2016-05-05 22:23:24 +02:00
parent d79bc0b398
commit 80d5f5f995
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C

View File

@ -3,7 +3,7 @@ Date: Wed, 9 Mar 2016 06:46:44 +0100
Subject: netifd: update to latest git master
diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile
index 619024b..f7563d5 100644
index 619024b..84a4592 100644
--- a/package/network/config/netifd/Makefile
+++ b/package/network/config/netifd/Makefile
@@ -1,13 +1,13 @@
@ -11,7 +11,7 @@ index 619024b..f7563d5 100644
PKG_NAME:=netifd
-PKG_VERSION:=2015-12-16
+PKG_VERSION:=2016-03-07
+PKG_VERSION:=2016-03-31
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE_PROTO:=git
@ -19,7 +19,7 @@ index 619024b..f7563d5 100644
+PKG_SOURCE_URL=$(OPENWRT_GIT)/project/netifd.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=245527193e90906451be35c2b8e972b8712ea6ab
+PKG_SOURCE_VERSION:=bd1ee3efb46ae013d81b1aec51668e7595274e69
+PKG_SOURCE_VERSION:=6fd6be6b7f3fc4883fdc464fcbcb2b5e8d8e8174
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
# PKG_MIRROR_MD5SUM:=
@ -53,3 +53,130 @@ index af3aaa8..5515b91 100755
for dev in $(echo "$radio_devs" | sort -u); do
/sbin/wifi up "$dev"
done
diff --git a/package/network/config/netifd/patches/0001-Revert-device-Don-t-process-link-events-anymore-in-d.patch b/package/network/config/netifd/patches/0001-Revert-device-Don-t-process-link-events-anymore-in-d.patch
new file mode 100644
index 0000000..312964f
--- /dev/null
+++ b/package/network/config/netifd/patches/0001-Revert-device-Don-t-process-link-events-anymore-in-d.patch
@@ -0,0 +1,121 @@
+From e0f19fdae88f3ef505e22533915f8328f4793980 Mon Sep 17 00:00:00 2001
+Message-Id: <e0f19fdae88f3ef505e22533915f8328f4793980.1462479663.git.mschiffer@universe-factory.net>
+From: Matthias Schiffer <mschiffer@universe-factory.net>
+Date: Thu, 5 May 2016 21:49:33 +0200
+Subject: [PATCH] Revert "device: Don't process link events anymore in device
+ user specific callback handlers"
+
+This reverts commit 4902ba2999dec02e82066d70ab6096b852a33007.
+---
+ device.h | 2 ++
+ macvlan.c | 8 ++++++++
+ system-linux.c | 2 +-
+ vlan.c | 6 ++++++
+ vlandev.c | 8 ++++++++
+ 5 files changed, 25 insertions(+), 1 deletion(-)
+
+diff --git a/device.h b/device.h
+index ac77cfb..ef1c608 100644
+--- a/device.h
++++ b/device.h
+@@ -59,6 +59,8 @@ struct device_type {
+ struct list_head list;
+ const char *name;
+
++ bool keep_link_status;
++
+ const struct uci_blob_param_list *config_params;
+
+ struct device *(*create)(const char *name, struct blob_attr *attr);
+diff --git a/macvlan.c b/macvlan.c
+index a0f11ae..051fe05 100644
+--- a/macvlan.c
++++ b/macvlan.c
+@@ -72,6 +72,12 @@ macvlan_base_cb(struct device_user *dev, enum device_event ev)
+ case DEV_EVENT_REMOVE:
+ device_set_present(&mvdev->dev, false);
+ break;
++ case DEV_EVENT_LINK_UP:
++ device_set_link(&mvdev->dev, true);
++ break;
++ case DEV_EVENT_LINK_DOWN:
++ device_set_link(&mvdev->dev, false);
++ break;
+ default:
+ return;
+ }
+@@ -255,6 +261,8 @@ macvlan_create(const char *name, struct blob_attr *attr)
+ const struct device_type macvlan_device_type = {
+ .name = "MAC VLAN",
+ .config_params = &macvlan_attr_list,
++ .keep_link_status = true,
++
+ .create = macvlan_create,
+ .config_init = macvlan_config_init,
+ .reload = macvlan_reload,
+diff --git a/system-linux.c b/system-linux.c
+index 351a994..794c1dd 100644
+--- a/system-linux.c
++++ b/system-linux.c
+@@ -464,7 +464,7 @@ static int cb_rtnl_event(struct nl_msg *msg, void *arg)
+ goto out;
+
+ struct device *dev = device_get(nla_data(nla[IFLA_IFNAME]), false);
+- if (!dev)
++ if (!dev || dev->type->keep_link_status)
+ goto out;
+
+ if (!system_get_dev_sysctl("/sys/class/net/%s/carrier", dev->ifname, buf, sizeof(buf)))
+diff --git a/vlan.c b/vlan.c
+index ac434ce..8d93799 100644
+--- a/vlan.c
++++ b/vlan.c
+@@ -79,6 +79,11 @@ static void vlan_dev_cb(struct device_user *dep, enum device_event ev)
+ case DEV_EVENT_REMOVE:
+ device_set_present(&vldev->dev, new_state);
+ break;
++ case DEV_EVENT_LINK_UP:
++ new_state = true;
++ case DEV_EVENT_LINK_DOWN:
++ device_set_link(&vldev->dev, new_state);
++ break;
+ case DEV_EVENT_UPDATE_IFNAME:
+ vlan_dev_set_name(vldev, dep->dev);
+ device_broadcast_event(&vldev->dev, ev);
+@@ -97,6 +102,7 @@ static struct device *get_vlan_device(struct device *dev, int id, bool create)
+ static const struct device_type vlan_type = {
+ .name = "VLAN",
+ .config_params = &device_attr_list,
++ .keep_link_status = true,
+ .free = free_vlan_if,
+ };
+ struct vlan_device *vldev;
+diff --git a/vlandev.c b/vlandev.c
+index b93527c..884e6ef 100644
+--- a/vlandev.c
++++ b/vlandev.c
+@@ -63,6 +63,12 @@ vlandev_base_cb(struct device_user *dev, enum device_event ev)
+ case DEV_EVENT_REMOVE:
+ device_set_present(&mvdev->dev, false);
+ break;
++ case DEV_EVENT_LINK_UP:
++ device_set_link(&mvdev->dev, true);
++ break;
++ case DEV_EVENT_LINK_DOWN:
++ device_set_link(&mvdev->dev, false);
++ break;
+ default:
+ return;
+ }
+@@ -243,6 +249,8 @@ vlandev_create(const char *name, struct blob_attr *attr)
+ const struct device_type vlandev_device_type = {
+ .name = "VLANDEV",
+ .config_params = &vlandev_attr_list,
++ .keep_link_status = true,
++
+ .create = vlandev_create,
+ .config_init = vlandev_config_init,
+ .reload = vlandev_reload,
+--
+2.8.2
+