]> git.baikalelectronics.ru Git - kernel.git/commit
neigh: sysctl - simplify address calculation of gc_* variables
authorMathias Krause <minipli@googlemail.com>
Sat, 12 Jul 2014 20:36:44 +0000 (22:36 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Jul 2014 21:32:51 +0000 (14:32 -0700)
commita9e8038a2ac5ecd7d4eee286372930ce8c3dd9b6
treeb1fc7364af39c287a118bd990ae2422db2a43d27
parent4cb759f1f7b817c3c4c53bc87f8db4a3e0b7eea0
neigh: sysctl - simplify address calculation of gc_* variables

The code in neigh_sysctl_register() relies on a specific layout of
struct neigh_table, namely that the 'gc_*' variables are directly
following the 'parms' member in a specific order. The code, though,
expresses this in the most ugly way.

Get rid of the ugly casts and use the 'tbl' pointer to get a handle to
the table. This way we can refer to the 'gc_*' variables directly.

Similarly seen in the grsecurity patch, written by Brad Spengler.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Cc: Brad Spengler <spender@grsecurity.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/neighbour.h
net/core/neighbour.c