Skip to content

Commit

Permalink
tipc: Fix bug in topology server byte swapping routine
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
ajstephens authored and davem330 committed May 19, 2008
1 parent 8e9501f commit fc5ad58
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/tipc/subscr.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ static struct top_srv topsrv = { 0 };

static u32 htohl(u32 in, int swap)
{
char *c = (char *)&in;

return swap ? ((c[3] << 3) + (c[2] << 2) + (c[1] << 1) + c[0]) : in;
return swap ? (u32)___constant_swab32(in) : in;
}

/**
Expand Down

0 comments on commit fc5ad58

Please sign in to comment.