tipc: don't reroute message fragments
authorErik Hugne <erik.hugne@ericsson.com>
Wed, 6 Nov 2013 08:28:05 +0000 (09:28 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 7 Nov 2013 23:30:11 +0000 (18:30 -0500)
When a message fragment is received in a broadcast or unicast link,
the reception code will append the fragment payload to a big reassembly
buffer through a call to the function tipc_recv_fragm(). However, after
the return of that call, the logics goes on and passes the fragment
buffer to the function tipc_net_route_msg(), which will simply drop it.
This behavior is a remnant from the now obsolete multi-cluster
functionality, and has no relevance in the current code base.

Although currently harmless, this unnecessary call would be fatal
after applying the next patch in this series, which introduces
a completely new reassembly algorithm. So we change the code to
eliminate the redundant call.

Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/bcast.c
net/tipc/link.c

index 716de1ac6cb560c8cc55a257a0d76d39230634f3..766a6eb4a88f798965845319693fa68d8890aed0 100644 (file)
@@ -487,11 +487,13 @@ receive:
                        spin_lock_bh(&bc_lock);
                        bclink_accept_pkt(node, seqno);
                        bcl->stats.recv_fragments++;
-                       if (ret > 0)
+                       if (ret > 0) {
                                bcl->stats.recv_fragmented++;
+                               spin_unlock_bh(&bc_lock);
+                               goto receive;
+                       }
                        spin_unlock_bh(&bc_lock);
                        tipc_node_unlock(node);
-                       tipc_net_route_msg(buf);
                } else if (msg_user(msg) == NAME_DISTRIBUTOR) {
                        spin_lock_bh(&bc_lock);
                        bclink_accept_pkt(node, seqno);
index 54163f91b8ae9a43ed1362e7e838b265d65bd598..ada8cadf5af8baf4c404f7f54b0d40b4fd6ceb6b 100644 (file)
@@ -1657,7 +1657,8 @@ deliver:
                        }
                        if (ret == -1)
                                l_ptr->next_in_no--;
-                       break;
+                       tipc_node_unlock(n_ptr);
+                       continue;
                case CHANGEOVER_PROTOCOL:
                        type = msg_type(msg);
                        if (link_recv_changeover_msg(&l_ptr, &buf)) {