diff for duplicates of <530656E7.7010404@gmail.com> diff --git a/a/1.txt b/N1/1.txt index d58fe92..e60000c 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -12,7 +12,7 @@ On 02/20/2014 06:53 AM, Daniel Borkmann wrote: Interesting. The problem above is actually triggered by sctp_retransmit(). When the T3-timeout occurs, we have -active_patch = retrans_path, and even though the timeout +active_patch == retrans_path, and even though the timeout occurred on the initial transmission of data, not a retransmit, we end up updating retransmit path. @@ -139,12 +139,12 @@ It might be worth adding adding this as a condition. See below. > + return sctp_trans_state_to_prio_map[trans->state]; > +} > -> - if (asoc->peer.transport_count = 1) +> - if (asoc->peer.transport_count == 1) > - return; > +static struct sctp_transport *sctp_trans_elect_best(struct sctp_transport *curr, > + struct sctp_transport *best) > +{ -> + if (best = NULL) +> + if (best == NULL) > + return curr; > > - /* Find the next transport in a round-robin fashion. */ @@ -156,7 +156,7 @@ It might be worth adding adding this as a condition. See below. > > - while (1) { > - /* Skip the head. */ -> - if (pos->next = head) +> - if (pos->next == head) > - pos = head->next; > - else > - pos = pos->next; @@ -167,7 +167,7 @@ It might be worth adding adding this as a condition. See below. > > - t = list_entry(pos, struct sctp_transport, transports); > + /* We're done as we only have the one and only path. */ -> + if (asoc->peer.transport_count = 1) +> + if (asoc->peer.transport_count == 1) > + return; > @@ -176,21 +176,21 @@ I think we should to do one more short circuit here: /* If active_path and retrans_path are the same and active, * then this is the only active path. Use it. */ - if (asoc->peer.active_path = asoc->peer.retrans_path && - asoc->peer.active_path->state = SCTP_ACTIVE) + if (asoc->peer.active_path == asoc->peer.retrans_path && + asoc->peer.active_path->state == SCTP_ACTIVE) return; > - /* We have exhausted the list, but didn't find any > - * other active transports. If so, use the next > - * transport. > - */ -> - if (t = asoc->peer.retran_path) { +> - if (t == asoc->peer.retran_path) { > - t = next; > + /* Iterate from retran_path's successor back to retran_path. */ > + for (trans = list_next_entry(trans, transports); 1; > + trans = list_next_entry(trans, transports)) { > + /* Manually skip the head element. */ -> + if (&trans->transports = &asoc->peer.transport_addr_list) +> + if (&trans->transports == &asoc->peer.transport_addr_list) > + continue; Alternative way would be: @@ -199,27 +199,27 @@ Alternative way would be: ... do the work... /* Manually skip head element if it's next */ - if (list_next_entry(trans, transports) = head) + if (list_next_entry(trans, transports) == head) trans = list_first_entry(head); } It's up to you if you like this better or not. -vlad -> + if (trans->state = SCTP_UNCONFIRMED) +> + if (trans->state == SCTP_UNCONFIRMED) > + continue; > + trans_next = sctp_trans_elect_best(trans, trans_next); > + /* Active is good enough for immediate return. */ -> + if (trans_next->state = SCTP_ACTIVE) +> + if (trans_next->state == SCTP_ACTIVE) > break; > - } > - > - /* Try to find an active transport. */ > - -> - if ((t->state = SCTP_ACTIVE) || -> - (t->state = SCTP_UNKNOWN)) { +> - if ((t->state == SCTP_ACTIVE) || +> - (t->state == SCTP_UNKNOWN)) { > + /* We've reached the end, time to update path. */ -> + if (trans = asoc->peer.retran_path) +> + if (trans == asoc->peer.retran_path) > break; > - } else { > - /* Keep track of the next transport in case @@ -255,11 +255,11 @@ It's up to you if you like this better or not. > * retran path, update the retran path and use it. > */ > - if (!last_sent_to) -> + if (last_sent_to = NULL) { +> + if (last_sent_to == NULL) { > return asoc->peer.active_path; > - else { > + } else { -> if (last_sent_to = asoc->peer.retran_path) +> if (last_sent_to == asoc->peer.retran_path) > sctp_assoc_update_retran_path(asoc); > + > return asoc->peer.retran_path; diff --git a/a/content_digest b/N1/content_digest index 519c626..8e0d301 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,7 +1,7 @@ "ref\01392897186-26841-1-git-send-email-dborkman@redhat.com\0" "From\0Vlad Yasevich <vyasevich@gmail.com>\0" "Subject\0Re: [PATCH net] net: sctp: fix multihoming retransmission path selection to rfc4960\0" - "Date\0Thu, 20 Feb 2014 19:26:31 +0000\0" + "Date\0Thu, 20 Feb 2014 14:26:31 -0500\0" "To\0Daniel Borkmann <dborkman@redhat.com>" " davem@davemloft.net\0" "Cc\0netdev@vger.kernel.org" @@ -23,7 +23,7 @@ "\n" "Interesting. The problem above is actually triggered by\n" "sctp_retransmit(). When the T3-timeout occurs, we have\n" - "active_patch = retrans_path, and even though the timeout\n" + "active_patch == retrans_path, and even though the timeout\n" "occurred on the initial transmission of data, not a retransmit,\n" "we end up updating retransmit path.\n" "\n" @@ -150,12 +150,12 @@ "> +\treturn sctp_trans_state_to_prio_map[trans->state];\n" "> +}\n" "> \n" - "> -\tif (asoc->peer.transport_count = 1)\n" + "> -\tif (asoc->peer.transport_count == 1)\n" "> -\t\treturn;\n" "> +static struct sctp_transport *sctp_trans_elect_best(struct sctp_transport *curr,\n" "> +\t\t\t\t\t\t struct sctp_transport *best)\n" "> +{\n" - "> +\tif (best = NULL)\n" + "> +\tif (best == NULL)\n" "> +\t\treturn curr;\n" "> \n" "> -\t/* Find the next transport in a round-robin fashion. */\n" @@ -167,7 +167,7 @@ "> \n" "> -\twhile (1) {\n" "> -\t\t/* Skip the head. */\n" - "> -\t\tif (pos->next = head)\n" + "> -\t\tif (pos->next == head)\n" "> -\t\t\tpos = head->next;\n" "> -\t\telse\n" "> -\t\t\tpos = pos->next;\n" @@ -178,7 +178,7 @@ "> \n" "> -\t\tt = list_entry(pos, struct sctp_transport, transports);\n" "> +\t/* We're done as we only have the one and only path. */\n" - "> +\tif (asoc->peer.transport_count = 1)\n" + "> +\tif (asoc->peer.transport_count == 1)\n" "> +\t\treturn;\n" "> \n" "\n" @@ -187,21 +187,21 @@ " /* If active_path and retrans_path are the same and active,\n" " * then this is the only active path. Use it.\n" " */\n" - " if (asoc->peer.active_path = asoc->peer.retrans_path &&\n" - " asoc->peer.active_path->state = SCTP_ACTIVE)\n" + " if (asoc->peer.active_path == asoc->peer.retrans_path &&\n" + " asoc->peer.active_path->state == SCTP_ACTIVE)\n" " return;\n" "\n" "> -\t\t/* We have exhausted the list, but didn't find any\n" "> -\t\t * other active transports. If so, use the next\n" "> -\t\t * transport.\n" "> -\t\t */\n" - "> -\t\tif (t = asoc->peer.retran_path) {\n" + "> -\t\tif (t == asoc->peer.retran_path) {\n" "> -\t\t\tt = next;\n" "> +\t/* Iterate from retran_path's successor back to retran_path. */\n" "> +\tfor (trans = list_next_entry(trans, transports); 1;\n" "> +\t trans = list_next_entry(trans, transports)) {\n" "> +\t\t/* Manually skip the head element. */\n" - "> +\t\tif (&trans->transports = &asoc->peer.transport_addr_list)\n" + "> +\t\tif (&trans->transports == &asoc->peer.transport_addr_list)\n" "> +\t\t\tcontinue;\n" "\n" "Alternative way would be:\n" @@ -210,27 +210,27 @@ " ... do the work...\n" "\n" " /* Manually skip head element if it's next */\n" - " if (list_next_entry(trans, transports) = head)\n" + " if (list_next_entry(trans, transports) == head)\n" " trans = list_first_entry(head);\n" " }\n" "\n" "It's up to you if you like this better or not.\n" "\n" "-vlad\n" - "> +\t\tif (trans->state = SCTP_UNCONFIRMED)\n" + "> +\t\tif (trans->state == SCTP_UNCONFIRMED)\n" "> +\t\t\tcontinue;\n" "> +\t\ttrans_next = sctp_trans_elect_best(trans, trans_next);\n" "> +\t\t/* Active is good enough for immediate return. */\n" - "> +\t\tif (trans_next->state = SCTP_ACTIVE)\n" + "> +\t\tif (trans_next->state == SCTP_ACTIVE)\n" "> \t\t\tbreak;\n" "> -\t\t}\n" "> -\n" "> -\t\t/* Try to find an active transport. */\n" "> -\n" - "> -\t\tif ((t->state = SCTP_ACTIVE) ||\n" - "> -\t\t (t->state = SCTP_UNKNOWN)) {\n" + "> -\t\tif ((t->state == SCTP_ACTIVE) ||\n" + "> -\t\t (t->state == SCTP_UNKNOWN)) {\n" "> +\t\t/* We've reached the end, time to update path. */\n" - "> +\t\tif (trans = asoc->peer.retran_path)\n" + "> +\t\tif (trans == asoc->peer.retran_path)\n" "> \t\t\tbreak;\n" "> -\t\t} else {\n" "> -\t\t\t/* Keep track of the next transport in case\n" @@ -266,11 +266,11 @@ "> \t * retran path, update the retran path and use it.\n" "> \t */\n" "> -\tif (!last_sent_to)\n" - "> +\tif (last_sent_to = NULL) {\n" + "> +\tif (last_sent_to == NULL) {\n" "> \t\treturn asoc->peer.active_path;\n" "> -\telse {\n" "> +\t} else {\n" - "> \t\tif (last_sent_to = asoc->peer.retran_path)\n" + "> \t\tif (last_sent_to == asoc->peer.retran_path)\n" "> \t\t\tsctp_assoc_update_retran_path(asoc);\n" "> +\n" "> \t\treturn asoc->peer.retran_path;\n" @@ -278,4 +278,4 @@ "> }\n" > -8c653847f5a2ff51abe74d1fe726c15d5dc9e837fbed31caecc4fd70fcd3ef96 +71ce345d93085b9cd4fcd42d6169b412598f53b273d9c90c51b3fee3f182f735
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.