diff options
author | Allan Stephens <allan.stephens@windriver.com> | 2008-05-19 16:29:06 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-05-19 16:29:06 -0400 |
commit | fc5ad582709ce9c7b9ab7b70c1e5b5e2cfc384db (patch) | |
tree | 361068dac2167badddd86ca5f8001c583a6a7fa1 /net/tipc | |
parent | 8e9501f5188d90eed737240453c32cad01849c96 (diff) |
tipc: Fix bug in topology server byte swapping routine
This patch fixes TIPC's topology server so that it does byte swapping
correctly when endianness conversion is required. (Note: This bug only
impacted an application if it issues a subscription request to a
topology server on another node, rather than the server on it's own
node; since the topology server is normally not accessible by off-node
applications, most TIPC applications were not impacted by the bug.)
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/subscr.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c index a62e5d30638c..dde23f1e7542 100644 --- a/net/tipc/subscr.c +++ b/net/tipc/subscr.c | |||
@@ -86,9 +86,7 @@ static struct top_srv topsrv = { 0 }; | |||
86 | 86 | ||
87 | static u32 htohl(u32 in, int swap) | 87 | static u32 htohl(u32 in, int swap) |
88 | { | 88 | { |
89 | char *c = (char *)∈ | 89 | return swap ? (u32)___constant_swab32(in) : in; |
90 | |||
91 | return swap ? ((c[3] << 3) + (c[2] << 2) + (c[1] << 1) + c[0]) : in; | ||
92 | } | 90 | } |
93 | 91 | ||
94 | /** | 92 | /** |