From: Allan Stephens Date: Mon, 19 May 2008 20:29:06 +0000 (-0700) Subject: tipc: Fix bug in topology server byte swapping routine X-Git-Tag: MMI-PSA29.97-13-9~33552^2~433 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fc5ad582709ce9c7b9ab7b70c1e5b5e2cfc384db;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Signed-off-by: David S. Miller --- 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 }; static u32 htohl(u32 in, int swap) { - char *c = (char *)∈ - - return swap ? ((c[3] << 3) + (c[2] << 2) + (c[1] << 1) + c[0]) : in; + return swap ? (u32)___constant_swab32(in) : in; } /**