[SRU][Trusty][PATCH 2/5] rtnl/do_setlink(): set modified when IFLA_TXQLEN is updated
Joseph Salisbury
joseph.salisbury at canonical.com
Fri Jun 2 15:19:41 UTC 2017
From: Nicolas Dichtel <nicolas.dichtel at 6wind.com>
BugLink: http://bugs.launchpad.net/bugs/1690094
The only effect of this patch is to print a warning if IFLA_TXQLEN is updated
and a following change fails.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel at 6wind.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
(cherry picked from commit 5d1180fcacc5ceb7da5494acfe9c5e4ebad4f281)
Signed-off-by: Joseph Salisbury <joseph.salisbury at canonical.com>
---
net/core/rtnetlink.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index d8638b9..6b48fca 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1582,8 +1582,14 @@ static int do_setlink(const struct sk_buff *skb,
modified = 1;
}
- if (tb[IFLA_TXQLEN])
- dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]);
+ if (tb[IFLA_TXQLEN]) {
+ unsigned long value = nla_get_u32(tb[IFLA_TXQLEN]);
+
+ if (dev->tx_queue_len ^ value)
+ modified = 1;
+
+ dev->tx_queue_len = value;
+ }
if (tb[IFLA_OPERSTATE])
set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]));
--
2.7.4
More information about the kernel-team
mailing list