Skip to content
Commit 9ecf07a1 authored by Mathias Krause's avatar Mathias Krause Committed by David S. Miller
Browse files

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: default avatarMathias Krause <minipli@googlemail.com>
Cc: Brad Spengler <spender@grsecurity.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8f2e5ae4
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment