diff options
| -rw-r--r-- | net/ipv4/syncookies.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c index f470fe4511db..177da14f6b14 100644 --- a/net/ipv4/syncookies.c +++ b/net/ipv4/syncookies.c | |||
| @@ -35,10 +35,12 @@ module_init(init_syncookies); | |||
| 35 | #define COOKIEBITS 24 /* Upper bits store count */ | 35 | #define COOKIEBITS 24 /* Upper bits store count */ |
| 36 | #define COOKIEMASK (((__u32)1 << COOKIEBITS) - 1) | 36 | #define COOKIEMASK (((__u32)1 << COOKIEBITS) - 1) |
| 37 | 37 | ||
| 38 | static DEFINE_PER_CPU(__u32, cookie_scratch)[16 + 5 + SHA_WORKSPACE_WORDS]; | ||
| 39 | |||
| 38 | static u32 cookie_hash(__be32 saddr, __be32 daddr, __be16 sport, __be16 dport, | 40 | static u32 cookie_hash(__be32 saddr, __be32 daddr, __be16 sport, __be16 dport, |
| 39 | u32 count, int c) | 41 | u32 count, int c) |
| 40 | { | 42 | { |
| 41 | __u32 tmp[16 + 5 + SHA_WORKSPACE_WORDS]; | 43 | __u32 *tmp = __get_cpu_var(cookie_scratch); |
| 42 | 44 | ||
| 43 | memcpy(tmp + 3, syncookie_secret[c], sizeof(syncookie_secret[c])); | 45 | memcpy(tmp + 3, syncookie_secret[c], sizeof(syncookie_secret[c])); |
| 44 | tmp[0] = (__force u32)saddr; | 46 | tmp[0] = (__force u32)saddr; |
