summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Brauner <christian@brauner.io>2018-09-04 21:53:51 +0200
committerDavid S. Miller <davem@davemloft.net>2018-09-05 22:27:11 -0700
commit87ccbb1f943625884b824c5560f635dcea8e4510 (patch)
tree90e6dc1b7e7dfacd0970a32400deada16b3bdce4
parent6ecf4c37eb3e89b0832c9616089a5cdca3747da7 (diff)
downloadtalos-obmc-linux-87ccbb1f943625884b824c5560f635dcea8e4510.tar.gz
talos-obmc-linux-87ccbb1f943625884b824c5560f635dcea8e4510.zip
rtnetlink: move type calculation out of loop
I don't see how the type - which is one of RTM_{GETADDR,GETROUTE,GETNETCONF} - can change. So do the message type calculation once before entering the for loop. Signed-off-by: Christian Brauner <christian@brauner.io> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/core/rtnetlink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index c49097237c30..7110ce32e848 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -3269,13 +3269,13 @@ static int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb)
{
int idx;
int s_idx = cb->family;
+ int type = cb->nlh->nlmsg_type - RTM_BASE;
if (s_idx == 0)
s_idx = 1;
for (idx = 1; idx <= RTNL_FAMILY_MAX; idx++) {
struct rtnl_link **tab;
- int type = cb->nlh->nlmsg_type-RTM_BASE;
struct rtnl_link *link;
rtnl_dumpit_func dumpit;
OpenPOWER on IntegriCloud