From: Allan Stephens <allan.stephens@windriver.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, allan.stephens@windriver.com
Subject: [PATCH 3/5 net-next-2.6] [TIPC]: Fix bug in topology server byte swapping routine
Date: Tue, 13 May 2008 14:17:43 -0400 [thread overview]
Message-ID: <1210702665-5012-4-git-send-email-allan.stephens@windriver.com> (raw)
In-Reply-To: <1210702665-5012-1-git-send-email-allan.stephens@windriver.com>
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>
---
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 a62e5d3..dde23f1 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;
}
/**
--
1.5.3.2
next prev parent reply other threads:[~2008-05-13 18:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-13 18:17 [PATCH 0/5 net-next-2.6] [TIPC]: Network topology server modifications Allan Stephens
2008-05-13 18:17 ` [PATCH 1/5 net-next-2.6] [TIPC]: Add support for customized subscription overlap handling Allan Stephens
2008-05-19 20:30 ` David Miller
2008-05-13 18:17 ` [PATCH 2/5 net-next-2.6] [TIPC]: Add support for customized subscription endianness Allan Stephens
2008-05-19 20:30 ` David Miller
2008-05-13 18:17 ` Allan Stephens [this message]
2008-05-19 20:30 ` [PATCH 3/5 net-next-2.6] [TIPC]: Fix bug in topology server byte swapping routine David Miller
2008-05-13 18:17 ` [PATCH 4/5 net-next-2.6] [TIPC]: Consolidate subscriber & subscriber port references Allan Stephens
2008-05-19 20:30 ` David Miller
2008-05-13 18:17 ` [PATCH 5/5 net-next-2.6] [TIPC]: Cosmetic cleanup of topology service code Allan Stephens
2008-05-19 20:30 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1210702665-5012-4-git-send-email-allan.stephens@windriver.com \
--to=allan.stephens@windriver.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).