aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorAruna-Hewapathirane <aruna.hewapathirane@gmail.com>2014-01-11 07:15:59 -0500
committerDavid S. Miller <davem@davemloft.net>2014-01-14 18:15:25 -0500
commit63862b5bef7349dd1137e4c70702c67d77565785 (patch)
treead50ec4a9d67fd025a29093dc5a4b493fe02e8a5 /net/ipv6
parent825edac4e78ded9e621c167a4f47a2392bd9e082 (diff)
net: replace macros net_random and net_srandom with direct calls to prandom
This patch removes the net_random and net_srandom macros and replaces them with direct calls to the prandom ones. As new commits only seem to use prandom_u32 there is no use to keep them around. This change makes it easier to grep for users of prandom_u32. Signed-off-by: Aruna-Hewapathirane <aruna.hewapathirane@gmail.com> Suggested-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/addrconf.c4
-rw-r--r--net/ipv6/ip6_flowlabel.c2
-rw-r--r--net/ipv6/mcast.c10
3 files changed, 8 insertions, 8 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index b0cd122e5fb4..5329cccf55dc 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -3104,7 +3104,7 @@ static void addrconf_dad_kick(struct inet6_ifaddr *ifp)
3104 if (ifp->flags & IFA_F_OPTIMISTIC) 3104 if (ifp->flags & IFA_F_OPTIMISTIC)
3105 rand_num = 0; 3105 rand_num = 0;
3106 else 3106 else
3107 rand_num = net_random() % (idev->cnf.rtr_solicit_delay ? : 1); 3107 rand_num = prandom_u32() % (idev->cnf.rtr_solicit_delay ? : 1);
3108 3108
3109 ifp->dad_probes = idev->cnf.dad_transmits; 3109 ifp->dad_probes = idev->cnf.dad_transmits;
3110 addrconf_mod_dad_timer(ifp, rand_num); 3110 addrconf_mod_dad_timer(ifp, rand_num);
@@ -3117,7 +3117,7 @@ static void addrconf_dad_start(struct inet6_ifaddr *ifp)
3117 3117
3118 addrconf_join_solict(dev, &ifp->addr); 3118 addrconf_join_solict(dev, &ifp->addr);
3119 3119
3120 net_srandom(ifp->addr.s6_addr32[3]); 3120 prandom_seed((__force u32) ifp->addr.s6_addr32[3]);
3121 3121
3122 read_lock_bh(&idev->lock); 3122 read_lock_bh(&idev->lock);
3123 spin_lock(&ifp->lock); 3123 spin_lock(&ifp->lock);
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
index e7fb7106550f..cbc93517b455 100644
--- a/net/ipv6/ip6_flowlabel.c
+++ b/net/ipv6/ip6_flowlabel.c
@@ -210,7 +210,7 @@ static struct ip6_flowlabel *fl_intern(struct net *net,
210 spin_lock_bh(&ip6_fl_lock); 210 spin_lock_bh(&ip6_fl_lock);
211 if (label == 0) { 211 if (label == 0) {
212 for (;;) { 212 for (;;) {
213 fl->label = htonl(net_random())&IPV6_FLOWLABEL_MASK; 213 fl->label = htonl(prandom_u32())&IPV6_FLOWLABEL_MASK;
214 if (fl->label) { 214 if (fl->label) {
215 lfl = __fl_lookup(net, fl->label); 215 lfl = __fl_lookup(net, fl->label);
216 if (lfl == NULL) 216 if (lfl == NULL)
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index d18f9f903db6..7ff82b3e54b6 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -999,7 +999,7 @@ bool ipv6_chk_mcast_addr(struct net_device *dev, const struct in6_addr *group,
999 999
1000static void mld_gq_start_timer(struct inet6_dev *idev) 1000static void mld_gq_start_timer(struct inet6_dev *idev)
1001{ 1001{
1002 unsigned long tv = net_random() % idev->mc_maxdelay; 1002 unsigned long tv = prandom_u32() % idev->mc_maxdelay;
1003 1003
1004 idev->mc_gq_running = 1; 1004 idev->mc_gq_running = 1;
1005 if (!mod_timer(&idev->mc_gq_timer, jiffies+tv+2)) 1005 if (!mod_timer(&idev->mc_gq_timer, jiffies+tv+2))
@@ -1015,7 +1015,7 @@ static void mld_gq_stop_timer(struct inet6_dev *idev)
1015 1015
1016static void mld_ifc_start_timer(struct inet6_dev *idev, unsigned long delay) 1016static void mld_ifc_start_timer(struct inet6_dev *idev, unsigned long delay)
1017{ 1017{
1018 unsigned long tv = net_random() % delay; 1018 unsigned long tv = prandom_u32() % delay;
1019 1019
1020 if (!mod_timer(&idev->mc_ifc_timer, jiffies+tv+2)) 1020 if (!mod_timer(&idev->mc_ifc_timer, jiffies+tv+2))
1021 in6_dev_hold(idev); 1021 in6_dev_hold(idev);
@@ -1030,7 +1030,7 @@ static void mld_ifc_stop_timer(struct inet6_dev *idev)
1030 1030
1031static void mld_dad_start_timer(struct inet6_dev *idev, unsigned long delay) 1031static void mld_dad_start_timer(struct inet6_dev *idev, unsigned long delay)
1032{ 1032{
1033 unsigned long tv = net_random() % delay; 1033 unsigned long tv = prandom_u32() % delay;
1034 1034
1035 if (!mod_timer(&idev->mc_dad_timer, jiffies+tv+2)) 1035 if (!mod_timer(&idev->mc_dad_timer, jiffies+tv+2))
1036 in6_dev_hold(idev); 1036 in6_dev_hold(idev);
@@ -1061,7 +1061,7 @@ static void igmp6_group_queried(struct ifmcaddr6 *ma, unsigned long resptime)
1061 } 1061 }
1062 1062
1063 if (delay >= resptime) 1063 if (delay >= resptime)
1064 delay = net_random() % resptime; 1064 delay = prandom_u32() % resptime;
1065 1065
1066 ma->mca_timer.expires = jiffies + delay; 1066 ma->mca_timer.expires = jiffies + delay;
1067 if (!mod_timer(&ma->mca_timer, jiffies + delay)) 1067 if (!mod_timer(&ma->mca_timer, jiffies + delay))
@@ -2328,7 +2328,7 @@ static void igmp6_join_group(struct ifmcaddr6 *ma)
2328 2328
2329 igmp6_send(&ma->mca_addr, ma->idev->dev, ICMPV6_MGM_REPORT); 2329 igmp6_send(&ma->mca_addr, ma->idev->dev, ICMPV6_MGM_REPORT);
2330 2330
2331 delay = net_random() % unsolicited_report_interval(ma->idev); 2331 delay = prandom_u32() % unsolicited_report_interval(ma->idev);
2332 2332
2333 spin_lock_bh(&ma->mca_lock); 2333 spin_lock_bh(&ma->mca_lock);
2334 if (del_timer(&ma->mca_timer)) { 2334 if (del_timer(&ma->mca_timer)) {