linux-kernel-test/net/tipc
Neil Horman d88dca79d3 tipc: fix endianness on tipc subscriber messages
Remove htohl implementation from tipc

I was working on forward porting the downstream commits for TIPC and ran accross this one:
http://tipc.cslab.ericsson.net/cgi-bin/gitweb.cgi?p=people/allan/tipc.git;a=commitdiff;h=894279b9437b63cbb02405ad5b8e033b51e4e31e

I was going to just take it, when I looked closer and noted what it was doing.
This is basically a routine to byte swap fields of data in sent/received packets
for tipc, dependent upon the receivers guessed endianness of the peer when a
connection is established.  Asside from just seeming silly to me, it appears to
violate the latest RFC draft for tipc:
http://tipc.sourceforge.net/doc/draft-spec-tipc-02.txt
Which, according to section 4.2 and 4.3.3, requires that all fields of all
commands be sent in network byte order.  So instead of just taking this patch,
instead I'm removing the htohl function and replacing the calls with calls to
ntohl in the rx path and htonl in the send path.

As part of this fix, I'm also changing the subscr_cancel function, which
searches the list of subscribers, using a memcmp of the entire subscriber list,
for the entry to tear down.  unfortunately it memcmps the entire tipc_subscr
structure which has several bits that are private to the local side, so nothing
will ever match.  section 5.2 of the draft spec indicates the <type,upper,lower>
tuple should uniquely identify a subscriber, so convert subscr_cancel to just
match on those fields (properly endian swapped).

I've tested this using the tipc test suite, and its passed without issue.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-03-08 12:20:58 -08:00
..
addr.c
addr.h
bcast.c tipc: fix non-const printf format arguments 2009-03-18 19:11:29 -07:00
bcast.h tipc: fix non-const printf format arguments 2009-03-18 19:11:29 -07:00
bearer.c tipc: Fix oops on send prior to entering networked mode (v3) 2010-03-04 00:53:52 -08:00
bearer.h tipc: Fix oops on send prior to entering networked mode (v3) 2010-03-04 00:53:52 -08:00
cluster.c net: Move && and || to end of previous line 2009-11-29 16:55:45 -08:00
cluster.h tipc: Don't use structure names which easily globally conflict. 2008-09-02 23:38:32 -07:00
config.c tipc: Fix initialization sequence problems when entering network mode 2008-05-21 14:55:04 -07:00
config.h
core.c tipc: use kconfig to limit numeric ranges 2010-01-03 21:31:04 -08:00
core.h tipc: Fix initialization sequence problems when entering network mode 2008-05-21 14:55:04 -07:00
dbg.c tipc: fix non-const printf format arguments 2009-03-18 19:11:29 -07:00
dbg.h
discover.c tipc: Don't use structure names which easily globally conflict. 2008-09-02 23:38:32 -07:00
discover.h tipc: Minor optimizations to received message processing 2008-06-04 17:32:35 -07:00
eth_media.c net: remove needless (now buggy) & from dev->dev_addr 2009-05-17 11:59:47 -07:00
handler.c
Kconfig tipc: Clean up configuration file 2010-01-19 14:23:57 -08:00
link.c net: Move && and || to end of previous line 2009-11-29 16:55:45 -08:00
link.h tipc: Don't use structure names which easily globally conflict. 2008-09-02 23:38:32 -07:00
Makefile
msg.c tipc: Fix bugs in message error code display when debugging 2008-06-04 17:29:09 -07:00
msg.h tipc: Message rejection rework preparatory changes 2008-06-04 17:54:48 -07:00
name_distr.c tipc: Optimize message initialization routine 2008-06-04 17:37:34 -07:00
name_distr.h
name_table.c tipc: trivial endian annotation in debug statement 2008-11-07 23:37:50 -08:00
name_table.h tipc: Don't use structure names which easily globally conflict. 2008-09-02 23:38:32 -07:00
net.c tipc: Fix oops on send prior to entering networked mode (v3) 2010-03-04 00:53:52 -08:00
net.h tipc: Don't use structure names which easily globally conflict. 2008-09-02 23:38:32 -07:00
netlink.c genetlink: make netns aware 2009-07-12 14:03:27 -07:00
node_subscr.c tipc: Don't use structure names which easily globally conflict. 2008-09-02 23:38:32 -07:00
node_subscr.h tipc: Don't use structure names which easily globally conflict. 2008-09-02 23:38:32 -07:00
node.c tipc: fix non-const printf format arguments 2009-03-18 19:11:29 -07:00
node.h tipc: Don't use structure names which easily globally conflict. 2008-09-02 23:38:32 -07:00
port.c tipc: Eliminate improper use of TIPC_OK error code 2008-07-14 22:44:01 -07:00
port.h tipc: Don't use structure names which easily globally conflict. 2008-09-02 23:38:32 -07:00
ref.c tipc: Eliminate improper use of TIPC_OK error code 2008-07-14 22:44:01 -07:00
ref.h
socket.c net: backlog functions rename 2010-03-05 13:34:03 -08:00
subscr.c tipc: fix endianness on tipc subscriber messages 2010-03-08 12:20:58 -08:00
subscr.h tipc: fix endianness on tipc subscriber messages 2010-03-08 12:20:58 -08:00
user_reg.c tipc: Eliminate improper use of TIPC_OK error code 2008-07-14 22:44:01 -07:00
user_reg.h
zone.c tipc: Don't use structure names which easily globally conflict. 2008-09-02 23:38:32 -07:00
zone.h tipc: Don't use structure names which easily globally conflict. 2008-09-02 23:38:32 -07:00