Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d46f8dd87d9e7d5356891cbe97b8472e74db1413 Commit: d46f8dd87d9e7d5356891cbe97b8472e74db1413 Parent: d3e994830d35159320d0a98c36aa580410c29609 Author: Stephen Hemminger <[EMAIL PROTECTED]> AuthorDate: Sun Jan 20 17:19:43 2008 -0800 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Mon Jan 28 15:08:15 2008 -0800
[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 <[EMAIL PROTECTED]> Acked-by: Paul E. McKenney <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- 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 ba3a85e..4179758 100644 --- a/net/sched/sch_sfq.c +++ b/net/sched/sch_sfq.c @@ -386,7 +386,7 @@ static void sfq_perturbation(unsigned long arg) struct Qdisc *sch = (struct Qdisc*)arg; struct sfq_sched_data *q = qdisc_priv(sch); - get_random_bytes(&q->perturbation, 4); + q->perturbation = net_random(); if (q->perturb_period) mod_timer(&q->perturb_timer, jiffies + q->perturb_period); @@ -415,7 +415,7 @@ static int sfq_change(struct Qdisc *sch, struct rtattr *opt) del_timer(&q->perturb_timer); if (q->perturb_period) { mod_timer(&q->perturb_timer, jiffies + q->perturb_period); - get_random_bytes(&q->perturbation, 4); + q->perturbation = net_random(); } sch_tree_unlock(sch); return 0; @@ -443,7 +443,7 @@ static int sfq_init(struct Qdisc *sch, struct rtattr *opt) if (opt == NULL) { q->quantum = psched_mtu(sch->dev); q->perturb_period = 0; - get_random_bytes(&q->perturbation, 4); + q->perturbation = net_random(); } else { int err = sfq_change(sch, opt); if (err) - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html