diff options
Diffstat (limited to 'net/decnet/dn_table.c')
-rw-r--r-- | net/decnet/dn_table.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/decnet/dn_table.c b/net/decnet/dn_table.c index 6f8b5658cb4e..0ebc46af1bdd 100644 --- a/net/decnet/dn_table.c +++ b/net/decnet/dn_table.c | |||
@@ -46,7 +46,7 @@ struct dn_zone | |||
46 | u32 dz_hashmask; | 46 | u32 dz_hashmask; |
47 | #define DZ_HASHMASK(dz) ((dz)->dz_hashmask) | 47 | #define DZ_HASHMASK(dz) ((dz)->dz_hashmask) |
48 | int dz_order; | 48 | int dz_order; |
49 | u16 dz_mask; | 49 | __le16 dz_mask; |
50 | #define DZ_MASK(dz) ((dz)->dz_mask) | 50 | #define DZ_MASK(dz) ((dz)->dz_mask) |
51 | }; | 51 | }; |
52 | 52 | ||
@@ -84,14 +84,14 @@ static int dn_fib_hash_zombies; | |||
84 | 84 | ||
85 | static inline dn_fib_idx_t dn_hash(dn_fib_key_t key, struct dn_zone *dz) | 85 | static inline dn_fib_idx_t dn_hash(dn_fib_key_t key, struct dn_zone *dz) |
86 | { | 86 | { |
87 | u16 h = ntohs(key.datum)>>(16 - dz->dz_order); | 87 | u16 h = dn_ntohs(key.datum)>>(16 - dz->dz_order); |
88 | h ^= (h >> 10); | 88 | h ^= (h >> 10); |
89 | h ^= (h >> 6); | 89 | h ^= (h >> 6); |
90 | h &= DZ_HASHMASK(dz); | 90 | h &= DZ_HASHMASK(dz); |
91 | return *(dn_fib_idx_t *)&h; | 91 | return *(dn_fib_idx_t *)&h; |
92 | } | 92 | } |
93 | 93 | ||
94 | static inline dn_fib_key_t dz_key(u16 dst, struct dn_zone *dz) | 94 | static inline dn_fib_key_t dz_key(__le16 dst, struct dn_zone *dz) |
95 | { | 95 | { |
96 | dn_fib_key_t k; | 96 | dn_fib_key_t k; |
97 | k.datum = dst & DZ_MASK(dz); | 97 | k.datum = dst & DZ_MASK(dz); |
@@ -250,7 +250,7 @@ static int dn_fib_nh_match(struct rtmsg *r, struct nlmsghdr *nlh, struct dn_kern | |||
250 | 250 | ||
251 | for_nexthops(fi) { | 251 | for_nexthops(fi) { |
252 | int attrlen = nhlen - sizeof(struct rtnexthop); | 252 | int attrlen = nhlen - sizeof(struct rtnexthop); |
253 | dn_address gw; | 253 | __le16 gw; |
254 | 254 | ||
255 | if (attrlen < 0 || (nhlen -= nhp->rtnh_len) < 0) | 255 | if (attrlen < 0 || (nhlen -= nhp->rtnh_len) < 0) |
256 | return -EINVAL; | 256 | return -EINVAL; |
@@ -457,7 +457,7 @@ static int dn_fib_table_insert(struct dn_fib_table *tb, struct rtmsg *r, struct | |||
457 | 457 | ||
458 | dz_key_0(key); | 458 | dz_key_0(key); |
459 | if (rta->rta_dst) { | 459 | if (rta->rta_dst) { |
460 | dn_address dst; | 460 | __le16 dst; |
461 | memcpy(&dst, rta->rta_dst, 2); | 461 | memcpy(&dst, rta->rta_dst, 2); |
462 | if (dst & ~DZ_MASK(dz)) | 462 | if (dst & ~DZ_MASK(dz)) |
463 | return -EINVAL; | 463 | return -EINVAL; |
@@ -593,7 +593,7 @@ static int dn_fib_table_delete(struct dn_fib_table *tb, struct rtmsg *r, struct | |||
593 | 593 | ||
594 | dz_key_0(key); | 594 | dz_key_0(key); |
595 | if (rta->rta_dst) { | 595 | if (rta->rta_dst) { |
596 | dn_address dst; | 596 | __le16 dst; |
597 | memcpy(&dst, rta->rta_dst, 2); | 597 | memcpy(&dst, rta->rta_dst, 2); |
598 | if (dst & ~DZ_MASK(dz)) | 598 | if (dst & ~DZ_MASK(dz)) |
599 | return -EINVAL; | 599 | return -EINVAL; |