diff options
Diffstat (limited to 'src/compat/dst_cache')
-rw-r--r-- | src/compat/dst_cache/dst_cache.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compat/dst_cache/dst_cache.c b/src/compat/dst_cache/dst_cache.c index 145f112..24f1e90 100644 --- a/src/compat/dst_cache/dst_cache.c +++ b/src/compat/dst_cache/dst_cache.c @@ -152,8 +152,13 @@ EXPORT_SYMBOL_GPL(dst_cache_get_ip6); int dst_cache_init(struct dst_cache *dst_cache, gfp_t gfp) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) + BUG_ON(gfp & GFP_ATOMIC); + dst_cache->cache = alloc_percpu(struct dst_cache_pcpu); +#else dst_cache->cache = alloc_percpu_gfp(struct dst_cache_pcpu, gfp | __GFP_ZERO); +#endif if (!dst_cache->cache) return -ENOMEM; |