projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
NetLabel: add tag verification when adding new CIPSOv4 DOI definitions
[powerpc.git]
/
net
/
ipv4
/
multipath_wrandom.c
diff --git
a/net/ipv4/multipath_wrandom.c
b/net/ipv4/multipath_wrandom.c
index
d34a9fa
..
92b0482
100644
(file)
--- a/
net/ipv4/multipath_wrandom.c
+++ b/
net/ipv4/multipath_wrandom.c
@@
-12,7
+12,6
@@
* 2 of the License, or (at your option) any later version.
*/
* 2 of the License, or (at your option) any later version.
*/
-#include <linux/config.h>
#include <asm/system.h>
#include <asm/uaccess.h>
#include <linux/types.h>
#include <asm/system.h>
#include <asm/uaccess.h>
#include <linux/types.h>
@@
-61,8
+60,8
@@
struct multipath_dest {
struct list_head list;
const struct fib_nh *nh_info;
struct list_head list;
const struct fib_nh *nh_info;
- __
u32
netmask;
- __
u32
network;
+ __
be32
netmask;
+ __
be32
network;
unsigned char prefixlen;
struct rcu_head rcu;
unsigned char prefixlen;
struct rcu_head rcu;
@@
-77,7
+76,7
@@
struct multipath_route {
struct list_head list;
int oif;
struct list_head list;
int oif;
- __
u32
gw;
+ __
be32
gw;
struct list_head dests;
struct rcu_head rcu;
struct list_head dests;
struct rcu_head rcu;
@@
-129,8
+128,8
@@
static unsigned char __multipath_lookup_weight(const struct flowi *fl,
/* find state entry for destination */
list_for_each_entry_rcu(d, &target_route->dests, list) {
/* find state entry for destination */
list_for_each_entry_rcu(d, &target_route->dests, list) {
- __
u32 targetnetwork = fl->fl4_dst &
-
(0xFFFFFFFF >> (32 - d->prefixlen)
);
+ __
be32 targetnetwork = fl->fl4_dst &
+
inet_make_mask(d->prefixlen
);
if ((targetnetwork & d->netmask) == d->network) {
weight = d->nh_info->nh_weight;
if ((targetnetwork & d->netmask) == d->network) {
weight = d->nh_info->nh_weight;
@@
-218,8
+217,8
@@
static void wrandom_select_route(const struct flowi *flp,
*rp = decision;
}
*rp = decision;
}
-static void wrandom_set_nhinfo(__
u
32 network,
- __
u
32 netmask,
+static void wrandom_set_nhinfo(__
be
32 network,
+ __
be
32 netmask,
unsigned char prefixlen,
const struct fib_nh *nh)
{
unsigned char prefixlen,
const struct fib_nh *nh)
{
@@
-228,7
+227,7
@@
static void wrandom_set_nhinfo(__u32 network,
struct multipath_dest *d, *target_dest = NULL;
/* store the weight information for a certain route */
struct multipath_dest *d, *target_dest = NULL;
/* store the weight information for a certain route */
- spin_lock(&state[state_idx].lock);
+ spin_lock
_bh
(&state[state_idx].lock);
/* find state entry for gateway or add one if necessary */
list_for_each_entry_rcu(r, &state[state_idx].head, list) {
/* find state entry for gateway or add one if necessary */
list_for_each_entry_rcu(r, &state[state_idx].head, list) {
@@
-276,7
+275,7
@@
static void wrandom_set_nhinfo(__u32 network,
* we are finished
*/
* we are finished
*/
- spin_unlock(&state[state_idx].lock);
+ spin_unlock
_bh
(&state[state_idx].lock);
}
static void __multipath_free(struct rcu_head *head)
}
static void __multipath_free(struct rcu_head *head)
@@
-302,7
+301,7
@@
static void wrandom_flush(void)
for (i = 0; i < MULTIPATH_STATE_SIZE; ++i) {
struct multipath_route *r;
for (i = 0; i < MULTIPATH_STATE_SIZE; ++i) {
struct multipath_route *r;
- spin_lock(&state[i].lock);
+ spin_lock
_bh
(&state[i].lock);
list_for_each_entry_rcu(r, &state[i].head, list) {
struct multipath_dest *d;
list_for_each_entry_rcu(d, &r->dests, list) {
list_for_each_entry_rcu(r, &state[i].head, list) {
struct multipath_dest *d;
list_for_each_entry_rcu(d, &r->dests, list) {
@@
-315,7
+314,7
@@
static void wrandom_flush(void)
__multipath_free);
}
__multipath_free);
}
- spin_unlock(&state[i].lock);
+ spin_unlock
_bh
(&state[i].lock);
}
}
}
}