aboutsummaryrefslogtreecommitdiffstats
path: root/main/linux-virt-grsec/0001-net-inform-NETDEV_CHANGE-callbacks-which-flags-were-.patch
diff options
context:
space:
mode:
authorLeonardo Arena <rnalrd@alpinelinux.org>2013-06-11 09:48:45 +0000
committerLeonardo Arena <rnalrd@alpinelinux.org>2013-06-11 09:48:59 +0000
commitf3dd5095137cc77d9c634e5bb670b6f024d499ad (patch)
treefb32417505a0420cf7120a337181d5c4e5523b3c /main/linux-virt-grsec/0001-net-inform-NETDEV_CHANGE-callbacks-which-flags-were-.patch
parent47bb9d7aa2cac0320a6bbe5d052af53c3d57a9f1 (diff)
downloadaports-f3dd5095137cc77d9c634e5bb670b6f024d499ad.tar.bz2
aports-f3dd5095137cc77d9c634e5bb670b6f024d499ad.tar.xz
main/linux-virt-grsec: upgrade to 3.9.5
Diffstat (limited to 'main/linux-virt-grsec/0001-net-inform-NETDEV_CHANGE-callbacks-which-flags-were-.patch')
-rw-r--r--main/linux-virt-grsec/0001-net-inform-NETDEV_CHANGE-callbacks-which-flags-were-.patch68
1 files changed, 68 insertions, 0 deletions
diff --git a/main/linux-virt-grsec/0001-net-inform-NETDEV_CHANGE-callbacks-which-flags-were-.patch b/main/linux-virt-grsec/0001-net-inform-NETDEV_CHANGE-callbacks-which-flags-were-.patch
new file mode 100644
index 0000000000..7357a330f8
--- /dev/null
+++ b/main/linux-virt-grsec/0001-net-inform-NETDEV_CHANGE-callbacks-which-flags-were-.patch
@@ -0,0 +1,68 @@
+From 1225b1090991bdcab819bdab96be329397563f1c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
+Date: Thu, 23 May 2013 11:30:23 +0300
+Subject: [PATCH 1/6] net: inform NETDEV_CHANGE callbacks which flags were
+ changed
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+In certain cases (like the follow up commit to arp.c) will need to
+check which flags actually changed to avoid excessive work.
+
+Ben Hutchings nicely worded why to put these transient flags to
+struct net_device for the time being:
+> It's inelegant to put transient data associated with an event in a
+> persistent data structure. On the other hand, having every user cache
+> the old state is pretty awful as well.
+>
+> Really, netdev notifiers should be changed to accept a structure that
+> encapsulates the changes rather than just a pointer to the net_device.
+> But making such a change would be an enormous pain and error-prone
+> because notifier functions aren't type-safe.
+>
+> As an interim solution, I think either the general flags_changed or
+> old_flags would be preferable to defining extra transient flags.
+
+Signed-off-by: Timo Teräs <timo.teras@iki.fi>
+Acked-by: Ben Hutchings <bhutchings@solarflare.com>
+---
+ include/linux/netdevice.h | 4 +++-
+ net/core/dev.c | 5 ++++-
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
+index 6151e90..8b3c649 100644
+--- a/include/linux/netdevice.h
++++ b/include/linux/netdevice.h
+@@ -1112,7 +1112,9 @@ struct net_device {
+ /* Hardware header description */
+ const struct header_ops *header_ops;
+
+- unsigned int flags; /* interface flags (a la BSD) */
++ unsigned int flags; /* interface flags (a la BSD) */
++ unsigned int flags_changed; /* flags that are being changed
++ * valid during NETDEV_CHANGE notifier */
+ unsigned int priv_flags; /* Like 'flags' but invisible to userspace.
+ * See if.h for definitions. */
+ unsigned short gflags;
+diff --git a/net/core/dev.c b/net/core/dev.c
+index 9a278e9..2f3feae 100644
+--- a/net/core/dev.c
++++ b/net/core/dev.c
+@@ -4683,8 +4683,11 @@ void __dev_notify_flags(struct net_device *dev, unsigned int old_flags)
+ }
+
+ if (dev->flags & IFF_UP &&
+- (changes & ~(IFF_UP | IFF_PROMISC | IFF_ALLMULTI | IFF_VOLATILE)))
++ (changes & ~(IFF_UP | IFF_PROMISC | IFF_ALLMULTI | IFF_VOLATILE))) {
++ dev->flags_changed = changes;
+ call_netdevice_notifiers(NETDEV_CHANGE, dev);
++ dev->flags_changed = 0;
++ }
+ }
+
+ /**
+--
+1.8.2.3
+