netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tipc: filter out messages not intended for this host
@ 2010-03-08 19:41 Neil Horman
  2010-03-08 20:20 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Neil Horman @ 2010-03-08 19:41 UTC (permalink / raw)
  To: netdev; +Cc: allan.stephens, nhorman, davem

Port commit 20deb48d16fdd07ce2fdc8d03ea317362217e085
from git://tipc.cslab.ericsson.net/pub/git/people/allan/tipc.git

Part of the larger effort I'm trying to help with getting all the downstreamed
code from windriver forward ported to the upstream tree

Origional commit message
Restore check to filter out inadverdently received messages
This patch reimplements a check that allows TIPC to discard messages
that are not intended for it.  This check was present in TIPC 1.5/1.6,
but was removed by accident during the development of TIPC 1.7; it has
now been updated to account for new features present in TIPC 1.7 and
reinserted into TIPC.  The main benefit of this check is to filter
out messages arriving from orphaned link endpoints, which can arise
when a node exits the network and then re-enters it with a different
TIPC network address (i.e. <Z.C.N> value).

tested with the tipc sanity test suite.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Origionally-authored-by: Allan Stephens <allan.stephens@windriver.com>


 link.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/net/tipc/link.c b/net/tipc/link.c
index 6f50f64..da3a384 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1882,6 +1882,15 @@ void tipc_recv_msg(struct sk_buff *head, struct tipc_bearer *tb_ptr)
 			     (msg_destnode(msg) != tipc_own_addr)))
 			goto cont;
 
+		/* Discard non-routeable messages destined for another node */
+
+		if (unlikely(!msg_isdata(msg) && 
+			     (msg_destnode(msg) != tipc_own_addr))) {
+			if ((msg_user(msg) != CONN_MANAGER) &&
+			    (msg_user(msg) != MSG_FRAGMENTER))
+				goto cont;
+		}
+
 		/* Locate unicast link endpoint that should handle message */
 
 		n_ptr = tipc_node_find(msg_prevnode(msg));

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] tipc: filter out messages not intended for this host
  2010-03-08 19:41 [PATCH] tipc: filter out messages not intended for this host Neil Horman
@ 2010-03-08 20:20 ` David Miller
  2010-03-08 20:39   ` Neil Horman
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2010-03-08 20:20 UTC (permalink / raw)
  To: nhorman; +Cc: netdev, allan.stephens

From: Neil Horman <nhorman@tuxdriver.com>
Date: Mon, 8 Mar 2010 14:41:49 -0500

> Port commit 20deb48d16fdd07ce2fdc8d03ea317362217e085
> from git://tipc.cslab.ericsson.net/pub/git/people/allan/tipc.git
> 
> Part of the larger effort I'm trying to help with getting all the downstreamed
> code from windriver forward ported to the upstream tree
> 
> Origional commit message
> Restore check to filter out inadverdently received messages
> This patch reimplements a check that allows TIPC to discard messages
> that are not intended for it.  This check was present in TIPC 1.5/1.6,
> but was removed by accident during the development of TIPC 1.7; it has
> now been updated to account for new features present in TIPC 1.7 and
> reinserted into TIPC.  The main benefit of this check is to filter
> out messages arriving from orphaned link endpoints, which can arise
> when a node exits the network and then re-enters it with a different
> TIPC network address (i.e. <Z.C.N> value).
> 
> tested with the tipc sanity test suite.
> 
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> Origionally-authored-by: Allan Stephens <allan.stephens@windriver.com>

Adds trailing whitespace, please fix:

davem@sunset:~/src/GIT/net-2.6$ pcheck diff
+ git apply --check --whitespace=error-all diff
diff:11: trailing whitespace.
		if (unlikely(!msg_isdata(msg) && 
fatal: 1 line adds whitespace errors.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] tipc: filter out messages not intended for this host
  2010-03-08 20:20 ` David Miller
@ 2010-03-08 20:39   ` Neil Horman
  2010-03-08 20:44     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Neil Horman @ 2010-03-08 20:39 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, allan.stephens

On Mon, Mar 08, 2010 at 12:20:30PM -0800, David Miller wrote:
> From: Neil Horman <nhorman@tuxdriver.com>
> Date: Mon, 8 Mar 2010 14:41:49 -0500
> 
> > Port commit 20deb48d16fdd07ce2fdc8d03ea317362217e085
> > from git://tipc.cslab.ericsson.net/pub/git/people/allan/tipc.git
> > 
> > Part of the larger effort I'm trying to help with getting all the downstreamed
> > code from windriver forward ported to the upstream tree
> > 
> > Origional commit message
> > Restore check to filter out inadverdently received messages
> > This patch reimplements a check that allows TIPC to discard messages
> > that are not intended for it.  This check was present in TIPC 1.5/1.6,
> > but was removed by accident during the development of TIPC 1.7; it has
> > now been updated to account for new features present in TIPC 1.7 and
> > reinserted into TIPC.  The main benefit of this check is to filter
> > out messages arriving from orphaned link endpoints, which can arise
> > when a node exits the network and then re-enters it with a different
> > TIPC network address (i.e. <Z.C.N> value).
> > 
> > tested with the tipc sanity test suite.
> > 
> > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > Origionally-authored-by: Allan Stephens <allan.stephens@windriver.com>
> 
> Adds trailing whitespace, please fix:
> 
> davem@sunset:~/src/GIT/net-2.6$ pcheck diff
> + git apply --check --whitespace=error-all diff
> diff:11: trailing whitespace.
> 		if (unlikely(!msg_isdata(msg) && 
> fatal: 1 line adds whitespace errors.
> 
> 


Apologies, heres the repost, whitespace fixed


Port commit 20deb48d16fdd07ce2fdc8d03ea317362217e085
from git://tipc.cslab.ericsson.net/pub/git/people/allan/tipc.git

Part of the large effort I'm trying to help with getting all the downstreamed
code from windriver forward ported to the upstream tree

Origional commit message
Restore check to filter out inadverdently received messages
This patch reimplements a check that allows TIPC to discard messages
that are not intended for it.  This check was present in TIPC 1.5/1.6,
but was removed by accident during the development of TIPC 1.7; it has
now been updated to account for new features present in TIPC 1.7 and
reinserted into TIPC.  The main benefit of this check is to filter
out messages arriving from orphaned link endpoints, which can arise
when a node exits the network and then re-enters it with a different
TIPC network address (i.e. <Z.C.N> value).

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Origionally-authored-by: Allan Stephens <allan.stephens@windriver.com>


 link.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/net/tipc/link.c b/net/tipc/link.c
index 6f50f64..da3a384 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1882,6 +1882,15 @@ void tipc_recv_msg(struct sk_buff *head, struct tipc_bearer *tb_ptr)
 			     (msg_destnode(msg) != tipc_own_addr)))
 			goto cont;
 
+		/* Discard non-routeable messages destined for another node */
+
+		if (unlikely(!msg_isdata(msg) &&
+			     (msg_destnode(msg) != tipc_own_addr))) {
+			if ((msg_user(msg) != CONN_MANAGER) &&
+			    (msg_user(msg) != MSG_FRAGMENTER))
+				goto cont;
+		}
+
 		/* Locate unicast link endpoint that should handle message */
 
 		n_ptr = tipc_node_find(msg_prevnode(msg));

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] tipc: filter out messages not intended for this host
  2010-03-08 20:39   ` Neil Horman
@ 2010-03-08 20:44     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2010-03-08 20:44 UTC (permalink / raw)
  To: nhorman; +Cc: netdev, allan.stephens

From: Neil Horman <nhorman@tuxdriver.com>
Date: Mon, 8 Mar 2010 15:39:24 -0500

> Apologies, heres the repost, whitespace fixed

Applied, thanks Neil.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-03-08 20:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-08 19:41 [PATCH] tipc: filter out messages not intended for this host Neil Horman
2010-03-08 20:20 ` David Miller
2010-03-08 20:39   ` Neil Horman
2010-03-08 20:44     ` David Miller

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).