Repository navigation
Commit 9ecf07a
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>1 parent 8f2e5ae commit 9ecf07a
2 files changed
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
207 | 206 | | |
208 | 207 | | |
209 | 208 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3059 | 3059 | | |
3060 | 3060 | | |
3061 | 3061 | | |
| 3062 | + | |
3062 | 3063 | | |
3063 | | - | |
3064 | | - | |
3065 | | - | |
3066 | | - | |
| 3064 | + | |
| 3065 | + | |
| 3066 | + | |
| 3067 | + | |
3067 | 3068 | | |
3068 | 3069 | | |
3069 | 3070 | | |
| |||
0 commit comments