build: resolve compile error with Linux 3.13

net_random has been removed in commit v3.14-rc1~94^2~191 and replaced
by its definition, prandom_u32.

prandom_u32 was only introduced in v3.8-rc1~74^2~22, so we will have
an extra ifdef for 3.7 support.
This commit is contained in:
Jan Engelhardt
2014-04-18 19:06:59 +02:00
parent ae307c0bf3
commit f2e21e67a5
3 changed files with 9 additions and 5 deletions

View File

@@ -68,7 +68,7 @@ xt_chaos_total(struct sk_buff *skb, const struct xt_action_param *par)
ret = xm_tcp->match(skb, &local_par);
hotdrop = local_par.hotdrop;
}
if (!ret || hotdrop || (unsigned int)net_random() > delude_percentage)
if (!ret || hotdrop || (unsigned int)prandom_u32() > delude_percentage)
return;
destiny = (info->variant == XTCHAOS_TARPIT) ? xt_tarpit : xt_delude;
@@ -98,7 +98,7 @@ chaos_tg(struct sk_buff *skb, const struct xt_action_param *par)
const struct xt_chaos_tginfo *info = par->targinfo;
const struct iphdr *iph = ip_hdr(skb);
if ((unsigned int)net_random() <= reject_percentage) {
if ((unsigned int)prandom_u32() <= reject_percentage) {
struct xt_action_param local_par;
local_par.in = par->in;
local_par.out = par->out;