diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-01-20 20:19:43 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:08:15 -0500 |
commit | d46f8dd87d9e7d5356891cbe97b8472e74db1413 (patch) | |
tree | d241545e59e75966cecd9c28afb0ecab02f728ce | |
parent | d3e994830d35159320d0a98c36aa580410c29609 (diff) |
[PKT_SCHED] SFQ: use net_random
SFQ doesn't need true random numbers, it is only using them to salt a
hash. Therefore it is better to use net_random() and avoid any
possible problems with depleting the entropy pool.
Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/sched/sch_sfq.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c index ba3a85e29b21..4179758450f5 100644 --- a/net/sched/sch_sfq.c +++ b/net/sched/sch_sfq.c | |||
@@ -386,7 +386,7 @@ static void sfq_perturbation(unsigned long arg) | |||
386 | struct Qdisc *sch = (struct Qdisc*)arg; | 386 | struct Qdisc *sch = (struct Qdisc*)arg; |
387 | struct sfq_sched_data *q = qdisc_priv(sch); | 387 | struct sfq_sched_data *q = qdisc_priv(sch); |
388 | 388 | ||
389 | get_random_bytes(&q->perturbation, 4); | 389 | q->perturbation = net_random(); |
390 | 390 | ||
391 | if (q->perturb_period) | 391 | if (q->perturb_period) |
392 | mod_timer(&q->perturb_timer, jiffies + q->perturb_period); | 392 | mod_timer(&q->perturb_timer, jiffies + q->perturb_period); |
@@ -415,7 +415,7 @@ static int sfq_change(struct Qdisc *sch, struct rtattr *opt) | |||
415 | del_timer(&q->perturb_timer); | 415 | del_timer(&q->perturb_timer); |
416 | if (q->perturb_period) { | 416 | if (q->perturb_period) { |
417 | mod_timer(&q->perturb_timer, jiffies + q->perturb_period); | 417 | mod_timer(&q->perturb_timer, jiffies + q->perturb_period); |
418 | get_random_bytes(&q->perturbation, 4); | 418 | q->perturbation = net_random(); |
419 | } | 419 | } |
420 | sch_tree_unlock(sch); | 420 | sch_tree_unlock(sch); |
421 | return 0; | 421 | return 0; |
@@ -443,7 +443,7 @@ static int sfq_init(struct Qdisc *sch, struct rtattr *opt) | |||
443 | if (opt == NULL) { | 443 | if (opt == NULL) { |
444 | q->quantum = psched_mtu(sch->dev); | 444 | q->quantum = psched_mtu(sch->dev); |
445 | q->perturb_period = 0; | 445 | q->perturb_period = 0; |
446 | get_random_bytes(&q->perturbation, 4); | 446 | q->perturbation = net_random(); |
447 | } else { | 447 | } else { |
448 | int err = sfq_change(sch, opt); | 448 | int err = sfq_change(sch, opt); |
449 | if (err) | 449 | if (err) |